A tweet-size scripting language for a Twitter-based game making tool.
@gdevbot # script
Tweet this script
πŸŒ…βž°
πŸ§πŸ›„πŸ”‘βœ‚
πŸš©πŸš—β­•πŸ”ƒ
↔↕
β“πŸ”€β©βͺ
βœ‹πŸ‘‹πŸ‘†β˜
πŸŽ²πŸ†™γ€°πŸŒˆ
πŸŒ… ➰

Init, Once, Always

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.

🐧

Current actor

A single script can be attached on a multitude of actors. The penguin emoji represents the actor the script is currently dealing with.

🚩 πŸš—

Position, Move

Use the flag to set or get an actor's position.

🚩🐧 20 30

Use the car to move an actor by a certain offset.

πŸš—πŸ§ 10 -5
β­• πŸ”ƒ

Angle, Rotate

Use the circle to set or get an actor's angle.

β­•πŸ§ 45

Use the clockwise arrows to rotate an actor.

πŸ”ƒπŸ§ 5
↔ ↕

Sprite width & height

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
πŸ”‘

Key

The key lets you access properties of an object.

For instance, you can access the x or y component of a position.

πŸš©πŸ§βœ‚πŸ”‘x

See below for an explanation about the scissors and why they're required.

βœ‚

End of expression

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".

πŸ›„

Assignment

You can assign values to properties. A value can be any expression and you can use common arithmetic operators.

πŸ›„πŸ§πŸ”‘ prop 5

You can also use the baggage emoji to assign values to global variables:

πŸ›„myGlobal 1
β“πŸ”€

Conditions

Only execute the statement right after if the condition turns out to be true.

❓condition statement

You can use common comparison operators like < ≀ = β‰₯ > β‰ .

You can negate an expression (make something truthy false and vice versa) with the twisted arrows:

πŸ”€expression
⏩ βͺ

Code blocks

Group statements that should be affected by a condition. Or just because it's pretty.

βœ‹ πŸ‘‹ πŸ‘† ☝

Touch input

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:

βž°πŸš©πŸ§βœ‹πŸ”‘xβœ‹πŸ”‘y

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:

βž°πŸš—πŸ§πŸ‘‹πŸ”‘xπŸ‘‹πŸ”‘y

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.

βž°β“πŸ‘†πŸš©πŸ§βœ‹πŸ”‘xβœ‹πŸ”‘y
🎲

Random number generator

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).

🎲1 6

If instead you pass no values (using a pair of pair of scissors), it will return a floating-point number between 0 and 1.

πŸŽ²βœ‚βœ‚
πŸ†™

Absolute value

Use this emoji to get the absolute value of a number. Great for computing distances.

πŸ†™πŸš©πŸ§βœ‚πŸ”‘x
γ€°πŸŒˆ

Trigonometry

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.