Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
34 stars 4 forks source link

Once keyword #116

Open Unexian opened 1 year ago

Unexian commented 1 year ago

Check ([ ] -> [x]) all that apply, then describe the issue below:

My idea is simple: a keyword that restricts a rule to one application per turn. I have a game that has something that moves objects up, but I only want it to move once per turn. Another way you could do it is with 'setting objects' (transparent objects that get deleted post-turn), but I think it would be nice if there was a way to do it with just a keyword.

david-pfx commented 1 year ago

I support this. I call it the once prefix. It's on my list for PS Next.

Unexian commented 1 year ago

I support this. I call it the once prefix. It's on my list for PS Next.

I don't think it would work very well as a prefix because you might have multiple different objects that are trying to run the rule...

david-pfx commented 1 year ago

Sorry, don't understand. Objects don't run rules.

With a once rule prefix, instead of

What did you have in mind?

Unexian commented 1 year ago

Sorry, don't understand. Objects don't run rules.

With a once rule prefix, instead of

  • "Each rule gets applied in turn as often as it can be before the interpreter moves on to the next one" you get
  • "A once rule gets applied once before the interpreter moves on to the next one"

What did you have in mind?

That is what I had in mind, but I meant there might be multiple objects trying to be changed by the rule (like 2 objects trying to fall at the same time)

david-pfx commented 8 months ago

This feature is now implemented in PS Next.