On Fist
The block is called once each time the player closes their hand into a fist.
Appears in tab: Hand Tracking
On Fist Release
The block is called once each time the player opens their fist.
Appears in tab: Hand Tracking
Enable pinch to drag
Lets the player pick up the sprite by pinching over it. The sprite follows the hand until the player opens the pinch.
Appears in tab: Hand Tracking
Disable pinch to drag
Stops the player from picking up the sprite with a pinch. If the sprite is being held, it is dropped.
Appears in tab: Hand Tracking
Enable fist to drag
Lets the player pick up the sprite by closing their hand into a fist over it. The sprite follows the hand until the player opens the fist.
Appears in tab: Hand Tracking
Disable fist to drag
Stops the player from picking up the sprite with a fist. If the sprite is being held, it is dropped.
Appears in tab: Hand Tracking
Face Tracking extension
An extension that uses the computer's camera to follow the player's face. The game can react to where the face is, how big the head looks, how the head is tilted, and whether the mouth is open. The outline of the face is drawn over the game. The camera opacity and the colors are set in the Face Tracking tab.
Appears in tab: Face Tracking
x of (face)
Returns the x position of a point on the player's face, in game coordinates. Choose the point from the dropdown: nose, left eye, right eye, mouth, left ear, right ear, forehead, chin, top of head, top left of head or top right of head.
Appears in tab: Face Tracking
y of (face)
Returns the y position of a point on the player's face, in game coordinates. Choose the point from the dropdown: nose, left eye, right eye, mouth, left ear, right ear, forehead, chin, top of head, top left of head or top right of head.
Appears in tab: Face Tracking
Head width
Returns the width of the player's head, from ear to ear, in game units.
Appears in tab: Face Tracking
Head height
Returns the height of the player's head, from the chin to the top of the head, in game units.
Appears in tab: Face Tracking
Head tilt
Returns how much the player's head is tilted, in degrees. It is 0 when the eyes are level and grows clockwise, like a sprite's rotation.
Appears in tab: Face Tracking
Is mouth open
Returns true while the player's mouth is open, and false otherwise.
Appears in tab: Face Tracking
On Mouth Open
The block is called once each time the player opens their mouth.
Appears in tab: Face Tracking
On Mouth Close
The block is called once each time the player closes their mouth.
Appears in tab: Face Tracking
Sprite
A game object represented as an image on the screen at specific coordinates. Sprites also allow running animation, events and physics motion.
Appears in tab: SPRITES
Sprite's name
Used to reference the sprite throughout the game.
Appears in tab: SPRITES
Sprite's X
A property of the sprite. The sprite’s initial x position.
Appears in tab: SPRITES
Sprite's Y
A property of the sprite. The sprite’s initial y position.
Appears in tab: SPRITES
Rotation
A property of the sprite. Changing a sprite's rotation changes the way it is "pointing" by turning it about its center point.
Appears in tab: SPRITES
Immovable
A property of the sprite. This option applies when two sprites collide. Check this option when a sprite should not move during a collision with another sprite. If a sprite is not immovable another sprite that runs into it can push it.
Appears in tab: SPRITES
Allow gravity
A property of the sprite. Defines if the sprite is affected by gravity (checked) or not (unchecked). This option applies only when the game has gravity. If the game has gravity and this box is checked - when running the game the sprite will fall until it reaches a surface (world boundary, tiles, or another sprite). If the box is unchecked, the sprite will not move upon running the game.
Appears in tab: SPRITES
Collide world bounds
A property of the sprite. Defines whether the sprite collides with the world’s bounds (checked) or if it can move beyond it (unchecked).
Appears in tab: SPRITES
Show sprite
A property of the sprite. Show or hide the sprite on the game screen.
Appears in tab: SPRITES
Widget
A game object that displays information or interacts with the player.
Appears in tab: WIDGETS
Widget's name
Used to reference the widget throughout the game.
Appears in tab: WIDGETS
Show widget
Show or hide the widget on the game screen.
Appears in tab: WIDGETS
Sounds
A game object that represents a sound. The sound can be played using the Play block.
Appears in tab: WIDGETS
Sound's name
Used to reference the sound throughout the game.
Appears in tab: WIDGETS
Game
An object representing the game as a whole. Properties of the game object include the width and height of the game world, which sprite the game camera should follow, and the strength of gravity in the game world.
Appears in tab: GAME
World width
Sets the world’s width. The visible part of the world is 600 by 400.
Appears in tab: GAME
World height
Sets the world’s height. The visible part of the world is 600 by 400.
Appears in tab: GAME
Gravity
Defines the level of gravity in the game. Zero means that there is no gravity and the sprites do not fall down.
Appears in tab: GAME
Camera target
Defines which sprite to follow. This is useful if the game world is bigger than 600 by 400. When the target sprite moves, the game window will scroll to keep up with it.
Appears in tab: GAME
Physics
In game design physics refers to system used to make game objects behave like objects in the real world. For example, it is the physics system that stops a sprite from moving if it runs into a "solid" object like a tile or immovable sprite. In some games, the physics system also includes gravity that automatically caused objects to fall towards the bottom of the screen unless something stops them. In Game Builder there are two possible physics systems, ARCADE and P2. ARCADE is easier to use and should be the choice for most games. P2 allows for more realistic simulations and provides more control over sprites' speed and rotation.
Appears in tab: GAME
Tilemap
A game object made up of individual square tiles. Tiles can be used to "draw" the game world. They take up space and stop sprites from moving through them.
x, y coordinates
The world has width (represented by the x coordinates) and height (represented by the y coordinates). Each sprite in the world has x and y coordinates that define its position. The top left corner of the game world has coordinates x = 0, y = 0 As you move to the right, the value of x get bigger; as you move down, the value of y gets bigger. The x and y coordinates are displayed in the top left corner and are changed as the mouse cursor is moved.
Counter widget
The Counter widget is used to keep count and can be displayed in the game.
Appears in tab: WIDGETS
Text widget
The Text widget is used to display labels or texts on the game’s screen.
Appears in tab: WIDGETS
Timer widget
The Timer widget is used to time activities in the game. It counts the seconds backwards until it reaches zero.
Appears in tab: WIDGETS
On End
This block will be called when the timer's countdown reaches 0.
Appears in tab: WIDGETS
Clock widget
The Clock widget is used to show the elapsed time. It counts the elapsed seconds starting from 0.
Appears in tab: WIDGETS
Button widget
The Button widget is used to create a simple interface in the game.
Appears in tab: WIDGETS
On Down
This block is called repeatedly when the user clicks on the button for as long as the mouse button is held down.
Appears in tab: WIDGETS
button.On Click
This block is called just once when the user clicks on the button, at the time when the mouse button is released.
Appears in tab: WIDGETS
Dialog widget
The Dialog widget is used to display a message to the player. The message is a string.
Appears in tab: WIDGETS
On Confirm
This block is called when the user presses the check button on the dialog widget.
Appears in tab: WIDGETS
On Run
This block exists in each sprite and widget and cannot be deleted. When the player clicks on the Run button (to play the game), the blocks attached to the On Run block are executed.
Step
Makes the sprite try to move. The sprite's movement can be blocked if there are tiles or other sprites in the way. The value defines the number of pixels the sprite will move. Positive values tell the sprite to move to the right, negative values mean move to the left.
Appears in tab: Movement
Jump
Makes the sprite jump. The sprite will jump to a certain height (based on the gravity of the game).
Appears in tab: Movement
Get X
Get Y
Set X
Sets the sprite’s x position based on the value in the block. The sprite is placed at the new position.
Appears in tab: Movement
Set Y
Sets the sprite’s y position based on the value in the block. The sprite is placed at the new position.
Appears in tab: Movement
Get Rotation
Set Rotation
Rotates the sprite based on the value (given in degrees) in the block. Positive values rotate the sprite clockwise, negative values rotate counterclockwise.
Appears in tab: Movement
Set Speed
Sets the speed of the sprite. This block changes the speed of the sprite in multiples of its default speed (the default is 1). The block Set Speed doesn't move the sprite itself. Instead it affects how fast or slow the sprite moves when the block Step is called.
Appears in tab: Movement
Set Allow Gravity
Sets the allow gravity to true. When the block is called, the sprite will be affected by gravity.
Appears in tab: Movement
Thrust
Applies force that pushes the sprite towards the top of the screen. The number is the amount of force. If the game world includes gravity, this number must be large enough to overcome gravity or the sprite will not move.
Appears in tab: Movement
Rotate Left
Rotates the sprite to the left. The number is the speed with which the sprite starts rotating. The sprite slows down automatically so it will not spin forever.
Appears in tab: Movement
Rotate Right
Rotates the sprite to the right. The number is the speed with which the sprite starts rotating. The sprite slows down automatically so it will not spin forever.
Appears in tab: Movement
Get Velocity X
Get Velocity Y
On Key
The block is called each time a keyboard key is pressed. If the key that was pressed matches the character in this block, something can happen. You can choose the value in the dropdown. This block can be used to control elements of the game using the keyboard.
Appears in tab: Events
On Collide
The block is called each time two sprites collides: the sprite where the block resides and the sprite chosen in the dropdown.
Appears in tab: Events
On Collide With World Bounds
The block is called each time the sprite collides with one of the world bounds. When physics is ARCADE, Choose the edge of the world bounds from the dropdown so that something will happen in the collision event. If the physics system is P2 there is no way to tell which edge the collision was.
Appears in tab: Events
On Swipe
The block is called each time the user swipes on their touch screen. If the the direction of the swipe matches the character in this block, something can happen. You can choose the value in the dropdown. This block can be used to control elements of the game by swiping the screen.
Appears in tab: Events
On Click
On Game Tap
The block is called whenever the user clicks anywhere in the game world. There should be just one On Game Tap block in the game.
Appears in tab: Events
On Collide With Tilemap
On Update
The block is called every time the game screen redraws, usually 30 to 60 times per second. The On Update block can be used to control the sprite's behavior.
Appears in tab: Events
Show
Hide
Hides the sprite or the widget. Unlike the Destroy block, the object is not removed from the game world and can be made to reappear again by calling the Show block.
Appears in tab: Display
Destroy
Enable
Disable
Disable the sprite by removing it from the game. Unlike a hidden sprite (using the Hide block), other sprites will not be able to collide with a disabled sprite. Unlike a destroyed sprite (using the Destroy block), a disabled sprite can be brought back to the game by using the Enable block.
Appears in tab: Display
Get Scale
Set Scale
Sets the scale of the sprite. This block changes the scale of the sprite in multiples of its default size.
Appears in tab: Display
Set counter
Set text
A block of the Text and Dialog widgets. Sets the text to display in these widgets.
Appears in tab: WIDGETS
Set timer
Start clock
Get value
A block of the Counter widget. Returns the value of the counter.
Appears in tab: WIDGETS
Get seconds
A block of the Clock widget. Returns the number of seconds that have passed since the clock started running.
Appears in tab: WIDGETS
Play Sound
Reset Game
Pause Game
Unpause Game
Get Game Time
Shows the time elapsed in milliseconds (thousandths of a second).
Appears in tab: Game and Sounds
Loop
Repeat
If
if blocks are used for decision making. If the condition is true (yes), then the code inside the if block is executed.
Appears in tab: Control
If Else
If Else blocks are used for decision making.If the condition is true (yes), then the code inside the if block is executed. If the condition in the if block is false (no), then the code inside the else block is executed.
Appears in tab: Control
not
Reverses the condition:not true (yes) is false (no); not false (no) is true (yes).
Appears in tab: Logic and Data
and
Returns true (yes) when both conditions are true and false (no) otherwise.
Appears in tab: Logic and Data
or
Returns true (yes) when at least one of the conditions is true and false (no) otherwise. Change the dropdown in the and block to or.
Appears in tab: Logic and Data
Comparison ==
Compares the values on both of its sides. The result is true (yes) when both values are exactly the same and false (no) otherwise.
Appears in tab: Logic and Data
Comparison >
Compares the values on both of its sides. The result is true (yes) when the value on its left is greater than the value on its right. Change the dropdown in the = block to >.
Appears in tab: Logic and Data
Comparison <
Compares the values on both of its sides. The result is true (yes) when the value on its left is less than the value on its right. Change the dropdown in the = block to <.
Appears in tab: Logic and Data
Random
Returns a random number in between the range of the minimum and maximum numbers provided. Each call to this block can return a different number.
Appears in tab: Logic and Data
Create variable
Creates a variable. A variable stores a value that can be used and changed.
Appears in tab: Variables
set variable to
change variable by
Increases or decreases the value of the variable by the number specified in the block.
Appears in tab: Variables
Function
A function gives a name to a set of blocks. Once a function is defined, it can be used many times in the code. You can use the functions from other sprites. When in another sprite, the function block is defined in the Other objects' Functions library.
Appears in tab: Object's Functions
Function with return value
AI model
Models can be thought of as programs that learn from data. The learning is done in the training process. The models capture data and make predictions based on that. When we train the model, we categorize and label the data. We have two models: the image model and the pose model. The image model finds patterns in the images recorded. The pose model saves the distances between key points.
Appears in tab: AI
Webcam widget
The webcam widget is used with the AI model. After training a model, use the webcam when running the game to invoke the various classes defined in the model.
Appears in tab: WIDGETS
On Prediction
This block is called constantly and checks for the relevant class. When the prediction of the class is more than 95%, it will execute the blocks inside it.
Appears in tab: AI
Predict
Collide other sprites
A property of the sprite. Defines the interaction betwween two sprites. If checked, sprite will not be cross the boundary of another sprite and will not be able to occupy the same space (default). When unchecked, the sprite can overlap other sprites. Note: For a sprite to collide with another sprite, both sprites need to have this option checked.
Appears in tab: SPRITES
Draggable
A property for the sprite. This option will allow the user to move the sprite during the game by clicking and dragging the sprite (checked). When unchecked, the sprite can not be moved by dragging while the game is running (default).
Appears in tab: SPRITES
On Drag End
The block is called each time a user drags a sprite and then stops dragging the sprite (it is called when the movement is stopped, not when the sprite is released). On Drag End is only applicable when the Draggable option is enabled in the sprite options.
Appears in tab: Events
Get Distance From
Returns the distance between two sprites as a positive number. The first sprite is the sprite where the code exists and the second sprite is designated as the input drop down.
Appears in tab: Movement
Set Background
Updates the game background to a new value. When using this function, only CodeMonkey backgrounds can be chosen.
Appears in tab: Game and Sounds
Background image
A property for the game. This option will allow the user to change starting background image to either a CodeMonkey background or upload their own background image.
Appears in tab: GAME
From ... Get
This block allows you to retrieve either the X, Y, or Rotation value from another sprite in the program.
Appears in tab: Movement
Change Counter by
This will change the specified counter by a specific amount. The amount can be either positive or negative, but will be added to the existing value.
Appears in tab: WIDGETS
if ... return
The if ... return statement takes a conditional statement and if it is true, it returns a value. If it is false, the program just continues.
Appears in tab: Object's Functions
Change X by
Sets the sprite’s x position by adding the value in the block to the sprite's current x position. The sprite is placed at the new position.
Appears in tab: Movement
Change Y by
Sets the sprite’s y position by adding the value in the block to the sprite's current y position. The sprite is placed at the new position.
Appears in tab: Movement
Change Rotation by
Sets the sprite’s rotation by adding the value in the block to the sprite's current rotation.
Appears in tab: Movement
Is Enabled
Returns true if the sprite is enabled, and false if it was disabled with the Disable block.
Appears in tab: Display
Set Width
Sets the sprite's width, in pixels, by stretching it. Only the width changes; the height stays the same.
Appears in tab: Display
Get Width
Set Height
Sets the sprite's height, in pixels, by stretching it. Only the height changes; the width stays the same.
Appears in tab: Display
Get Height
Start Animation
Starts running one of the sprite's animations. Choose the animation from the dropdown, for example step. Only some of the sprites in the sprite library have animations.
Appears in tab: Display
Stop Animation
Stops the animation that is running. The next time the animation is started, it starts over from the beginning.
Appears in tab: Display
Set Velocity X
Sets the sprite's speed on the x axis, in pixels per second. Positive values move the sprite to the right, negative values move it to the left.
Appears in tab: Movement
Set Velocity Y
Sets the sprite's speed on the y axis, in pixels per second. Positive values move the sprite down, negative values move it up.
Appears in tab: Movement
Hand Tracking extension
An extension that uses the computer's camera to follow the player's hand. The camera finds 21 points on the hand, so the game can react to where the fingers are and to pinches and fists. The outline of the hand is drawn over the game, and it changes color when a pinch or a fist is detected. The camera opacity and the colors are set in the Hand Tracking tab.
Appears in tab: Hand Tracking
x of (hand)
Returns the x position of a point on the player's hand, in game coordinates. Choose the point from the dropdown: thumb, index finger, middle finger, ring finger, pinky or palm.
Appears in tab: Hand Tracking
y of (hand)
Returns the y position of a point on the player's hand, in game coordinates. Choose the point from the dropdown: thumb, index finger, middle finger, ring finger, pinky or palm.
Appears in tab: Hand Tracking
Is pinching
Returns true while the player is pinching (the thumb and the index finger are touching), and false otherwise.
Appears in tab: Hand Tracking
On Pinch
The block is called once each time the player pinches (brings the thumb and the index finger together).
Appears in tab: Hand Tracking
On Pinch Release
The block is called once each time the player opens a pinch.
Appears in tab: Hand Tracking
Is fist closed
Returns true while the player's hand is closed into a fist, and false otherwise.
Appears in tab: Hand Tracking