Giter Site home page Giter Site logo

increpare / puzzlescript Goto Github PK

View Code? Open in Web Editor NEW
897.0 35.0 157.0 22.88 MB

Open Source HTML5 Puzzle Game Engine

License: MIT License

CSS 2.14% HTML 4.84% JavaScript 92.81% Python 0.21% Batchfile 0.01%
puzzlescript javascript html5 game-engine scripting-language

puzzlescript's Introduction

puzzlescript's People

Contributors

andrew-cantina avatar bqqbarbhg avatar dario-zubovic avatar draknek avatar drambique avatar hcs64 avatar increpare avatar joeosborn avatar lazerwalker avatar maxflav avatar mechturk avatar misshapensmiley avatar olaron avatar pancelor avatar rickyz avatar rmmh avatar salty-horse avatar sfiera avatar sftrabbit avatar shuding avatar smattiso avatar tilmannr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puzzlescript's Issues

in-game messages case insensitive

In puzzlescript capital letters aren't working with the MESSAGE command (for rules)
Is this intentional? Or is it a bug?

But why is it case insensitive in rules when upper case works in the messages between levels?

Doesn't run with cookies disabled

Friend reported this, does seem to be the case that you get a blank page when trying to run a PuzzleScript game with cookies disabled.

Condition containing Ellipsis that leads to restart causes Uncaught TypeError

The line "Late vertical [Crate | ... | Player] -> restart" seems to cause an uncaught type error in the rulesToMask function in compiler.js, specifically when handling "...".

This causes the rebuild and run buttons to not work at all, and the reason for the error is also not apparent at first due to there being no obvious error message.

Editor hangs

I don't have a good repro for this yet. The whole editor page will lock up and no longer respond to mouse or keyboard input. It generally seems to happen while typing. I've seen it happen when typing an equals sign in a Legend line, and when typing a hash sign on a CollisionLayers line (I was trying to guess the comment syntax). The last time, I was lucky enough to have the debugging console open and could pause it and step through. The minified Javascript is a bit hard to decipher, but comparing it to the source I believe it was stuck in the loop in runMode. In this case, the content of the stream was just "#", and pos never moved beyond 0.

I'll follow-up if I find a reliable repro.

Uncaught TypeError compiling buggy code

Here's a minimal repro. If you try to compile this buggy code, the compiler dies with an uncaught exception. It should probably have reported an error that Bug hasn't been assigned to a layer, but as far as I can tell it's gotten to the point where it's trying to report that Bug and Background can't appear on the same tile, but it's tripping up because it assumes that Bug has a layer and it doesn't.

title Uncaught TypeError compiling buggy code
author Weeble

========
OBJECTS
========

Background1
LIGHTGREEN

Player 
Black

Bug
Red


=======
LEGEND
=======

P = Player
b = Bug and Background1 (This is bad. They shouldn't be on same tile.)
Background = Bug or Background1

=======
SOUNDS
=======

================
COLLISIONLAYERS
================

Background1 (Oops, we forgot to assign Bug to a layer.)
Player

======
RULES     
======     

==============
WINCONDITIONS
==============

=======     
LEVELS
=======

Pb

Long "message"s don't display properly instead of throwing an error

If a message is extremely long and the first message of the game, it doesn't display at all; it just waits for "x". To see this in action, put the following at the start of the levels section:

message Hello there, good reader. I don't know what the maximum message length is, so I figured I'd test it by typing this great big message. That way, I could get an idea for what the maximum message length is. Luckily, it seems to be pretty big, but ultimately I wonder if it splits long messages across pages, or more likely, if long messages just don't work properly.

message test

Also, if a message is just a little bit too long, the message will overwrite the word "continue" a bit and then following long messages can behave weirdly. For an example:

message Hello there, good reader. I don't know what the maximum message length is, so I figured I'd test it by typing this great big message. That way, I could get an idea for what the maximum message length is. Luckily, it seems to be pretty big, but ultimately I wonder if it splits long messages across pages, or more likely, if long 

message Hello there, good reader. I don't know what the maximum message length is, so I figured I'd test it by typing this great big message. That way, I could get an idea for what the maximum message length is. Luckily, it seems to be pretty big, but ultimately I wonder if it splits long messages across pages, or more likely, if long messages just don't work properly.

Bug when exporting a game using realtime_interval

If you try to export a game which uses beta features, you don't get a warning. This is probably fine since the exported code wouldn't ever change?

However, the exported game is still trying to display a warning message, by looking for an element with id "errormessage". There is no such element on the standalone page, so the javascript code errors, with the effect that it appears to be stuck on the loading screen.

(It's not actually stuck though, it's just not showing the title screen. If you press X it will start the game)

Level editor saves garbled level

http://www.puzzlescript.net/editor.html?hack=6893137

Open the level editor. Save. I see this output:

""""""undefinedundefinedundefined"""
"h""""undefinedundefinedundefined"$"
""""""undefinedundefinedundefined"""
""""""undefinedundefinedundefined"""
iundefinedundefinedundefinediundefinedundefinedundefinedundefinedundefinedundefinedundefined
"undefinedundefinedundefined"undefinedundefinedundefinedundefinedundefinedundefinedundefined
i"""iundefinedundefinedundefinedundefinedundefinedundefinedundefined
"undefinedundefinedundefined"undefinedundefinedundefinedundefinedundefinedundefinedundefined
iundefined@undefinediundefinedundefinedundefinedundefinedundefinedundefinedundefined

mute button for youtube music

when I share my puzzlescript game this is the most commonly requested thing - no idea how feasible it is, but thought I'd suggest it at least.

Legend is case-insensitive

I appreciate that the following may well fall into the category of "won't fix" :) as the general case-insensitivity of PuzzleScript is clearly a feature.

I'm working on a new game involving different animals. There's a marker to show the player which animal they are currently allowed to move. An extract from my current legend is this:

D = Dog and Floor and Marker
C = Cat and Floor and Marker
M = Mouse and Floor and Marker
d = Dog and Floor
c = Cat and Floor
m = Mouse and Floor

Sadly, this doesn't work, as 'm' and 'M' are treated the same, so, for example, on the cat and mouse level, where I want a controllable cat and uncontrollable mice, all my mice still end up with markers even if I've specified them with 'm'.

If legend characters were case-insensitive, it would be easier to create these levels directly, as I could use 'M' to denote 'Mouse and Floor and Marker' (controllable mouse) and 'm' to denote 'Mouse and Floor' (uncontrollable mouse).

Even if legends will always be case-insensitive, though, specifying eg both 'M' and 'm' in a legend ought to trigger some kind of 'Things Will Not Behave As You Expect' error message, since they won't.

Cheers,

Wayne

Can't use "sfx" with "cancel"

Attempting to pair the "cancel" keyword with a "sfx" keyword gives the following error: "The CANCEL command can only appear by itself on the right hand side of the arrow."

Since "cancel" is often used to block illegal moves, it seems like it would be useful to allow some kind of feedback sound to alert the player. Why not allow "sfx" (and maybe even "message") to be the exception to this rule?

Thanks!

verbose_logging is really slow

Looked into the specifics of this, it's because editing the console's innerHTML several hundred times in quick succession is slow. If the log entries are queued up and added all at once at the end of every turn, it should be totally useable.

Level editor seems to work correctly, but saves incorrect values for BG cells

Open the example in the editor then start the level editor. Select the white object (Background2) and paint some of it onto the map. Press the S button to save the level.

The regions you painted should be saved as the symbol "o", but they are in fact saved as the symbol "x". It's definitely related to having multiple backgrounds, but it doesn't always seem to happen solely from having multiple backgrounds.

My suspicion is that it's a bug in levelEditorClick. It looks like it tries to mix in the default background tile with every tile it saves, regardless of whether that tile already has a background tile. But I'm not entirely sure I understand the binary encoding used for tiles, nor how backgroundid relates to the objects you've declared as being background, so take that with a pinch of salt.

title Level editor background bug
author Weeble
homepage www.puzzlescript.net

OBJECTS

Background1
DARKGREY

Background2
WHITE

Player
RED

LEGEND

X = Background1
O = Background2
P = Player
Background = Background1 or Background2

SOUNDS

COLLISIONLAYERS

Background

RULES

WINCONDITIONS

LEVELS

XXXOOP
XXXOOO
XXXOOO

Allow Actions without movement to work with require_player_movement

I tried to use the Action action as a shortcut to skip levels (useful for prototyping), so have the rule:

[Action Player] -> WIN

However, since I also have require_player_movement as a prelude, when I hit the Action key, the win condition is not triggered as the Action action is cancelled (due to non-movement). Logs:

require_player_movement set, but no player movement detected, so cancelling turn.

An ugly work-around is to change the rule to include movement, eg:

[Action Player ] -> [> Player] WIN

I think it would be nice if Action could be considered a 'movement' or have another prelude that will encompass this (eg. require_player_movement_or_action)

"Hack" link doesn't work in Chrome

In Firefox, hack links work fine. In Chrome the link just goes to "#", and I get this error in the console:

Uncaught ReferenceError: Mobile is not defined

Links to homepage on exported pages are malformed

An example of the resulting malformed link: <a href="http://">www.puzzlescript.net</a>

It looks like the relevant portion from standalone.html isn't making it into the standalone_inlined template, as can be seen from the snippets below:

standalone.html: <a href="http://"+'"__HOMEPAGE__"'>"__HOMEPAGE__"</a>

standalone_inlined.txt: <a href="http://">"__HOMEPAGE__"</a>

I'd offer to post a fix, but I have no idea how the inlining works.

Can't use 'V' in legend

Attempting to use 'V' as a single-character descriptor in a legend results in the following error message:

"names cannot end with the letter "v", because it's is used as a direction."

I can vaguely see why this might be reasonable behaviour in object names, which must be parsed in conjunction with 'v' as direction in rules.

Harder to see why the ban on 'V' extends to the legend single-character descriptors used to construct the levels.

The workaround is of course simple - don't use 'V' in legends.

Additional layers or objects without collisions

It would be nice if there was a way to disable collisions on objects, or allow more layers. I'm probably pushing it, but I'm trying to implement a lot of mechanics in hidden objects on different layers, I don't want these objects to bump into each other.

I don't know what the engine looks like internally, but would it be hard to have one "no-collide" layer?

save player movement until next automatic turn with realtime_interval

When using realtime_interval it would be convenient if player movement was buffered until the next automatic turn rather than forcing a new independent turn.

I know this is possible to emulate by [ stationary Player ] in front of all your rules, but it's quite a pain, and I can't imagine a use case that'd be broken by changing this behaviour.

Exported Game Does Not Behave As Expected

Exported version of a game does not behave in the same way as the online version.

See eg http://www.puzzlescript.net/play.html?p=6850739

That works fine, both at the URL above and in the editor.

However, when I hit export, save the file locally, then run it from my local server, the local version works fine for the first couple of levels, which do not contain any moving NPCs, but seems to ignore most keypresses on the third level (and probably beyond), which does.

The editor palette doesn't appear when first opened

The first time you open the editor, the list of tiles at the top doesn't appear. You have to close and re-open edit mode to see them.

This also happens when you resize the level and that makes the game's scale change.

"got caught looping lots in a rule group" message is unhelpful

I've already remarked this on the forum, but seems to make sense to create an issue for it while I'm here.

This message is normally a sign that your code is doing something foolish, but it's often hard to work out exactly what's causing it. If the warning mentioned the rule id that was looping too much it would be very convenient!

bug with sound and again

There seems to be a bug with sound and again. With verbose_logging enabled, it seems to be undoing moves spontaneously and replaying them again, causing the sounds to occur twice in some circumstances. I've mitigated this to a degree by using SFXn instead.

Removing an object does not also remove its movement

When an object with movement is removed, another object placed at the same position will inherit the removed object's movement.

Here's an example to demonstrate:
http://www.puzzlescript.net/editor.html?hack=7078110

The replacement doesn't have to happen in the same rule – the orphaned movement will stick around until the end of the movement phase unless it's explicitly removed, which can make debugging quite confusing.

I think it's an overall improvement to always remove movement along with objects. Thus:

[ OldObject ] -> [ ]

should behave as if it were:

[ > OldObject ] -> [ ]
[ OldObject ] -> [ ]

If you really want the existing behaviour instead, you can acheive that with:

[ > OldObject ] -> [ > NewObject ]

(which in my opinion is a little nicer anyway, since it's more explicit about what's happening).

Keys get "stuck" when alt-tabbing

If I start a PuzzleScript game and hold an arrow key and alt-tab to a different window, depress the key, then alt-tab back, PuzzleScript thinks the key is still pressed.

It will keep triggering events until you press the arrow again, so PuzzleScript receives the "keyup". Unfortunately that doesn't always work.

I've tested this with Firefox and Chrome on several games, e.g. http://www.puzzlescript.net/play.html?p=6851495 (Just start the game and press the right arrow)

Browser tab close keyboard shortcut is ignored and creates stuck key

The W key gets stuck when I hit Command-W to close the tab in Firefox on Mac OS X. Not only does the tab not close, but also W (up) is continuously sent to the game until I press and release W again. Try it out when playing a game – the character in that game will continuously jump when you hit Command-W.

This bug does not happen in Chrome for Mac. I have not tried other browsers or other keyboard shortcuts.

Related to #38.

Level ends when removing Player while displaying a message during an again trigger.

I've found a problem where the level is ending without a win condition. It seems to occur if the Player is removed on the same turn a message is displayed and an again is triggered. No "Win Condition Satisfied" message is displayed but the game moves to the next level.

Here's an example:
http://www.puzzlescript.net/editor.html?hack=9124914

The win condition is "no Trigger". There is no rule that ever removes the Trigger, but the level ends when you stand on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.