Motion Bricks are used to set the position, direction, movement, and physics of objects. Position is set with a coordinate system similar to the Cartesian Plane, wherein the X and Y axes run along the center of the screen. Direction is set with the specified amount of degrees. Movement is set using steps/second, where steps refers to the distance traveled by a sprite along the X or Y axes. The physics engine, meanwhile, applies friction, gravity, and varying motion styles to different objects.


Place at X: (100) Y: (200)

"Place at"  brick as shown in Pocket Code

Places the sprite at the specified X and Y coordinates.

Set X to (100)

"Set X to" brick as seen in Pocket Code

Places the sprite at the specified X coordinate.

Set Y to (200)

"Set Y to" brick as seen in Pocket Code

Places the sprite at the specified Y coordinate.

Change X by (10)

"Change X by" brick as seen in Pocket Code

Changes the sprite's X coordinate by the given increment. This is equivalent to adding the increment to the current X coordinate. It is possible to decrease the X coordinate by using a negative increment as input.

Change Y by (10)

"Change Y by" brick as seen in Pocket Code

Changes the sprite's Y coordinate by the given increment. This is equivalent to adding the increment to the current Y coordinate. It is possible to decrease the Y coordinate by using a negative increment as input.

Go to (Touch position/Random position/Object)

The sprite goes either to the touch position, to a random position, or to the position of another object. These parameters are chosen from a drop-down list that appears when the brick is tapped.

"Go to touch position" brick

When using the touch position parameter, the brick checks if the screen is currently being touched (if screen_is_touched is true). If it is, the position of the sprite is centered at the touch position. If not, the position of the sprite remains at its last position.

"Go to random position" brick as seen in Pocket Code

When using the random position parameter, the position of the sprite is centered at any random on-screen X and Y coordinates.

"Go to object" brick

When using the object parameter, the screen centers the sprite at the selected object. In Pocket Code, the name of the objects to be chosen from is shown in the drop-down list.

When you bounce off

Screenshot_20190828-162936_Pocket Code.jpg

Runs the script when the object bounce off any edge, actor or object

If on edge, bounce

"If on edge" brick as seen in Pocket Code

Checks if the sprite is touching the edge of the screen and bounces off the edge if it is.

Move (10) steps

"Move steps" brick as seen in Pocket Code

Moves the sprite a certain number of steps.

Turn left (15) degrees

turn left.jpg

Rotates the sprite counter-clockwise by the specified amount of degrees.

Turn right (15) degrees

turn rigth.jpg

Rotates the sprite clockwise by the specified amount of degrees.

Point in direction (90) degrees

point in direction.jpg

Sets the direction of the sprite to the set number of degrees. Unlike "Turn left" or "Turn right," the sprite is set to the specified direction regardless of its previous orientation.

When using this brick, 90° is used to refer to the default, or upright, position. Increasing this value rotates the sprite clockwise, while decreasing this value rotates the sprite counter-clockwise.

Point towards (Object)

"Point towards" brick as seen in Pocket Code

Sets the direction of the sprite to point to the selected object. The chosen object can be changed from a drop-down list that appears when the brick is tapped.

Set rotation style (left-right only/all-around/don't rotate)

Sets the restrictions to rotating the sprite. The rotation style of the chosen object can be changed from a drop-down list that appears when the brick is tapped.

"Set rotation style to left-right only" brick

Left-right only restricts rotation to flipping the sprite horizontally. It may be used as animation for still sprites or in 2D games.

"Set rotation style to all around" brick

All-around allows the sprite to rotate normally in all directions. Since the default rotation style without using this brick is set to all around, this brick is best used when returning the rotation style to normal after having changed it.

"Set rotation style to don't rotate" brick

Don't rotate negates the effects of all bricks which alters the sprite's movement. This may be used when adding exceptions to rotation of a sprite.

Glide (1) second to X: (100) Y: (200)

"Glide to" brick as shown in Pocket Code

Moves the sprite to the specified X and Y coordinates within the input time. The higher the input time, the slower the speed of movement. The lower the input time, the faster the speed of movement.

Go back (1) layer

"Go back layer" brick as seen in Pocket Code

Moves the sprite backwards a specified number of layers in the layer stack. The higher the input number of layers, the more likely other sprites will overlap the object.

Go to front

"Go to front" brick as seen in Pocket Code

Moves the sprite to the uppermost layer in the layer stack. The sprite will overlap all other sprites when running the brick.

Vibrate for (1) second

"Vibrate for seconds"

Makes the user's device vibrate for the specified number of seconds. This is often used as an effect for games or as a notification to the user.

Set your motion type to

Sets the motion type of the sprite, which can be changed from a drop-down list that appears when the brick is tapped.

Screenshot_20190828-172223_Pocket Code.jpg

The "moving and bouncing under gravity" motion type allows the object to be influenced by physics, gravity, collisions, etc. For example, a ping-pong ball with this motion type may collide with other dynamic and fixed sprites.

The "not moving under gravity, but others bounce off" motion type sets the object to a "static" sprite, so that is not influenced by physics, gravity, collisions, etc. For example, the floor of an indestructible wall with this motion type collides with dynamic sprites only.

The "not moving or bouncing under gravity" motion type sets disables physics features for the sprite. For example, the default non-physics sprites have this motion type, such as backgrounds, which do not collide with any other physics objects.

Set velocity to X: (0) Y: (0) steps/second

"Set velocity to" brick

Sets the sprite's movement along the X and Y axes per second. Higher values correspond to higher velocity. Likewise, lower values correspond to lower velocity.

Spin left (15) degrees/second

Screenshot_20190828-172414_Pocket Code.jpg

Rotates the sprite counter-clockwise at a given amount of degrees per second.

Spin right (15) degrees/second

Screenshot_20190828-172435_Pocket Code.jpg

Rotates the sprite clockwise at a given amount of degrees per second.

Set gravity for all actors and X: (0) Y: (-10) steps/second²

Screenshot_20190828-172455_Pocket Code.jpg

Sets the gravity which affects all dynamic physics objects along the X and Y axes. Both positive and negative values are allowed for gravity on both X and Y axes.

Set mass to (1.0) kilogram

"Set mass to kilograms" brick

Sets an object's mass to a value of 0 or above. Setting an object's mass will not affect the speed of movement due to gravity.

Set bounce factor to (80%)

"Set bounce factor" brick

Sets how much of an object‘s velocity is lost (or gained) upon collision with another physics object to value of 0% or above. This also determines how violently objects bounce off of each other after collision. If both colliding objects have a bounce factor of 0, they do not bounce off each other at all upon collision.

Set friction to (20%)

"Set friction to" brick

Sets friction to a value of 0 or above, which determines how fast/easily physics objects can glide along one another. The higher the objects’ friction values, the slower they will glide on each other due to contact.