By default, your code will be executed a single time as soon as the game is loaded. This is useful for global initialization code that isn't linked to any actor.
Code located after the sunrise emoji will be executed once for each actor it is attached to, when the actor is instantiated or when the script gets attached to it.
Code located after the curly loop emoji will be executed every frame for each actor it is attached to.
A single script can be attached on a multitude of actors. The penguin emoji represents the actor the script is currently dealing with.
Use the flag to set or get an actor's position.
Use the car to move an actor by a certain offset.
Use the circle to set or get an actor's angle.
Use the clockwise arrows to rotate an actor.
You can get the sprite width and height for your computations.
For instance, this moves the actor by half its sprite's width:
/ 2 0
The key lets you access properties of an object.
For instance, you can access the x or y component of a position.
See below for an explanation about the scissors and why they're required.
Since emoji code doesn't use parentheses to delimit expressions, you will sometime need to use the scissors to explicitly mark the end of an expression.
If we didn't use the scissors in the Key example above, the code would be interpreted by the engine to mean "position of the property x of the actor", instead of "property x of the position of the actor".
You can assign values to properties. A value can be any expression and you can use common arithmetic operators.
You can also use the baggage emoji to assign values to global variables:
Only execute the statement right after if the condition turns out to be true.
You can use common comparison operators like < ≤ = ≥ > ≠.
You can negate an expression (make something truthy false and vice versa) with the twisted arrows:
Group statements that should be affected by a condition. Or just because it's pretty.
The hand represents the touch position on touch devices, or the mouse position while the left button is pressed on other devices.
You can use it to make an actor follow your pointer:
The waving hand represents the movement of the finger/pointing device that happened between the previous frame and the current one.
You can use it to drag an actor with your pointer:
The pointing fingers stand for start and end of a touch or mouse click.
You can use them in condition to react to those events.
For instance, this moves the actor to where the finger is pointing when a touch starts.
The die lets you generate a random number.
There are two ways to use it.
Put two numerical expressions right after it and it will generate a random integer between those two numbers (boundaries included).
If instead you pass no values (using a pair of pair of scissors), it will return a floating-point number between 0 and 1.
Use this emoji to get the absolute value of a number. Great for computing distances.
The wavy dash stands for the sine function, while the rainbow is for computing an angle from a Y and X values (the arctangent function).
The values passed shold be in degrees, not radians. You can get a cosine simply by adding 90° to the value passed to the sine function.