Motion Bricks

From Catrobat
Jump to: navigation, search

< Back to brick documentation


Watch the videos beside the bricks to get an explaination of the brick functionality.


PlaceAtBrick

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


Brick place at.png

Place the sprite to the specified X and Y position.

SetXBrick

Set X to (100)


Brick set x.png

Set the sprite´s X coordinate.

SetYBrick

Set Y to (200)


Brick set y.png

Set the sprite´s Y coordinate.

ChangeXByNBrick

Change X by:


Brick change x.png

Changes the sprite´s X coordinate values by the given increment.

ChangeYByNBrick

Change Y by:


Brick change y.png

Changes the sprite´s Y coordinate values by the given increment.

GoToBrick

Go to (Touch position / Random posiiton / object)


Brick go to.png

The object goes either to the touch posiiton, to a random position (any x/y position on the screen) or to another choosen object.

IfOnEdgeBounceBrick

If on edge, bounce


Brick if edge.png

If touching the edge of the screen it bounces away.

MoveNStepsBrick

Move 10 steps:


Brick move.png

Move the sprite a certain number of steps (e.g.: 10)

TurnLeftBrick

Turn left 15 degrees:


Brick turn left.png

Turns the sprite to the left (counter clockwise) by the specified degrees.

TurnRightBrick

Turn right 15 degrees:


Brick turn right.png

Turn the sprite to the right (clockwise) by the specified degrees.

PointInDirectionBrick

Point in direction 90 degrees:


Brick point.png

See the direction of the current sprite. (in degrees)

PointToBrick

Point towards ______:


Brick point towards.png

Sets the direction of the current sprite regarding another object.

GlideToBrick

Glide 1 second:


Brick glide.png

Glide within a certain time to the specified X,Y position.

GoNStepsBackBrick

Go back 1 layer:


Brick go back layer.png

Moves the sprite a given number of layers back in the layer stack.

ComeToFrontBrick

Go to front:


Brick go front.png

Bring the sprite to the frontmost layer so it covers all other sprites with overlapping positions.

Vibration brick

Vibrate for (1) second


Brick vibrate for.png

Let your device vibrate for certain seconds.

SetPhysicsObjectTypeBrick

Set motion type to


(bouncing)

Brick set-motion-type-to-bouncing.png

The object is influenced by gravity, collisions, etc., e.g. a ping-pong ball - collides with other dynamic and fixed sprites


(bounce off)

Brick set-motion-type-to-bounce-off.png

The object is not influenced by gravity, collisions or similar, a „static“ sprite per se, e.g. the floor or an indestructible wall - collides with dynamic sprites only.


(no bouncing)

Brick set-motion-type-to-no-bouncing.png

Physics features are disabled, the default non-physics sprites, e.g. background - does not collide with any other physics object

SetVelocityBrick

Set velocity to X: 0.0 Y:0.0 steps/second:


Brick set-velocity-to.png

Sets the object’s velocity along both X and Y axes.

TurnLeftSpeedBrick

Rotate left 15.0 degrees/second:


Brick rotate-left.png

Sets the object’s counter-clockwise rotational speed in degrees/second.

TurnRightSpeedBrick

Rotate right 15 degrees/second:


Brick rotate-right.png

Sets the object’s clockwise rotational speed in degrees/second.

SetGravityBrick

Set gravity for all objects to X: 0.0 Y: -10.0 steps/second²:


Brick set-gravity-for-all.png

Changes the physics world‘s gravity which affects all dynamic physics objects. Both positive and negative values are allowed for gravity on both X and Y axes.

SetMassBrick

Set mass to 1.0 kilogram:


Mass.png

Determines a object’s mass. Accepted values are 0 and above. Note that increasing an object’s mass will not increase the speed with which it will „fall“ due to gravity

SetBounceBrick

Set bounce factor to 80.0 %:


Brick set-bounce-factor.png

Determines how much of an object‘s energy/velocity is lost (or gained) upon collision with another physics object. Both colliding objects‘ BounceFactors are used to calculate how „violently“ the objects bounce off of each other. Accepted values are 0 and above, factors greater than 1 are also supported. If both colliding objects have a BounceFactor of 0 they do not bounce at all upon collision.

SetFrictionBrick

Set friction to 20.0 %:


Brick set-friction-to.png

Determines how fast/easily one physics object can glide along another. Accepted values are between 0 and 1, values greater than 1 are accepted as well. The higher the objects’ friction values, the slower they will glide.