DON'T USE THIS; IT IS EXTREMELY SLOW This is an event-based, game-loop-based engine which allows for frame-by-frame execution of scripts - as opposed to the typical "concurrent" method, where multiple forever loops run at once, or whatever. This ensures that only one step of execution happens per frame, and everything happens *in order*. == How to use == === Loops === When the project runs, it broadcasts the "setup" event. At this point, every sprite with a "setup" event will execute the subsequent commands. This includes all initialisation / setting variables and states; imagine anything you'd put under "when green flag clicked". Then, the "draw" event is executed once per frame. This is a kind of global forever loop that every sprite can use; use this for actions of a sprite that do not depend directly on user input - for example things that need to execute every frame, or instructions based on the current state of the game (e.g. the number of lives). After the first (0th) frame, other events, such as input-based events, can be sent and received. This is because the event-sending broadcast depends on the previous execution, meaning that there is no input data to send events (e.g. key presses) from on frame 0. === Keys === When the "key pressed" broadcast is sent, every sprite with a "when I receive key pressed" block will execute that script. This means that it can check WHICH key is pressed, e.g. it can ask if "pressed contains (key name)?", e.g. pressed contains (left arrow)? is true if you began pressing left arrow on that frame. In contrast, the key HELD event runs once for every frame where the key is down, but is being held (rather than pressed or released) === Variables === If a variable present in the "globals" list changes, its corresponding name (you need to add its name to "global variable names) is added to the "changed" array. This means (if changed contains (var name)) will run if the variable changed on that frame. This is useful if you want to send specific broadcasts based on a variable changing. In addition, if the variable changes to "true", then it is added to "pressed" (yes, I know it doesn't make sense) to signify that it has been toggled ON. Likewise, when it changes to "false", it is added to "released". These two lists can then be checked in "send events" to see if a given variable has changed to true or false; if it doesn't matter what it changes to, or it doesn't vary only between true or false, then it can be checked in "changed". So, in summary: input / var changes in a frame --> it goes to "changed" input / var turns "true" in a frame --> it goes to "pressed" input / var turn "false" in a frame --> it goes to "released" input /var stays the same over a frame --> it goes to "held"
Let me know if there are any staggering bugs - there undoubtedly are, of course... All work by me; thanks to the Scratch Team for making this possible! ^^ "I encourage you to use it and try to make something with it! :)" - me before realizing "is () in (list)" takes forever. Don't use this unless you are a fan of extreme lag.