1

Sensing (16/16)

1. mouse [pressed]

  • It is a Boolean type block, which would return either true or false.

  • Report true if the mouse is pressed / clicked / released when the game is running.

2. key [a] [pressed]

  • It is a Boolean type block.

  • Report true if specified key is pressed, and run the following script.

  • The difference between "when [a] [pressed]" and "key [a] [pressed]":

    They are in different block boxes but have the same function. Press the specified key can trigger both blocks.

    Please note: if you keep pressing the specified key, this block ([pressed] condition) will be triggered all the time.

StatePressed; Released
Key26 characters, number 0-9, arrow keys, Space bar, Enter key, any key

3. [itself] touching [Codemao]

  • It is a Boolean type block.

  • Detect whether the specified sprite or camp is touching other sprite or camp.

4. [itself] touching color [color]

  • It is a Boolean type block.

  • Report true if the specified sprite is touching the specified color when the game is running.

  • Color code:

From FFFFFF to 000000. In hexadecimal, FF means 255 and 00 means 0.

The first two is for color red; the middle two is for green; the last two is for color blue.

5. leave screen [edge]

  • Report true if the sprite is leaving the edge of screen when the game is running.

6. [leave] screen (1)

  • It is a Boolean type block.

  • Report true if the sprite leaves or stays in the specified screen when the game is running.

  • Tip:

    "leave screen edge" block can detect whether the sprite leaves the stage edge, but "leave screen 1" block can detect whether the sprite leaves the edge of current screen among several screen.

    Use this block properly to stop unnecessary script after the sprite leave current screen. It can make the game run smoothly.

7. [X position] of [itself]

  • Get the specified data of current sprite or other specified sprite.

  • Data includes: X position, Y position, style number, rotation degree, style name, size, color, transparency, brightness, etc.

  • The digrees of [rotation] is the same as "point in direction" block.

Take the sprite that faces right as an example:

8. distance to [mouse-pointer]

  • Get the distance from the sprite to specified sprite or mouse pointer.

9. phone rotation around [X] axis

  • Report rotating value (X or Y axis) of the mobile device.

  • Please note: mobile gyroscope is needed.

Axis
XPositive value means that the screen rotates towards the right, whereas negative one means towards the left.
YPositive value means that the screen rotates upwards, whereas negative one means downwards.
  • Application:

    In mobile games, you can use mobile phone rotation to control the direction or movement of the sprite.

    It can be used in similar mobile games like Temple Run and Subway Surfers.

10. mouse [X] coordinate

  • Report the x or y position of mouse pointer.

11. stage [width]

  • Report the width or height of the stage.
Portrait stageH900 X W620
Landscape 4:3 stageH720 X W960
Landscape 16:9 stageH720 X W1280

12. current [year]

  • Report the current [year/month/date/week/hour/minute/second].

  • Application: this block can be used to make clock.

13. timer

  • Report the value of the timer.

14. reset timer

  • Set the timer to zero in running game.

15. [enable] voice detection

  • Enable or disable the voice detection.

  • Please note: if voice detection is disabled, current volume cannot be get.

16. current volume

  • Report current sound volume.