0% found this document useful (0 votes)
54 views1 page

1ab. Sprite Falling

The document outlines a code structure for a sprite that falls randomly on the screen. It specifies the sprite's falling speed and includes a condition to reset its position when it reaches a certain point on the y-axis, simulating the sprite touching the ground. The code is designed to repeat the sprite's actions indefinitely.

Uploaded by

judeperesso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1 page

1ab. Sprite Falling

The document outlines a code structure for a sprite that falls randomly on the screen. It specifies the sprite's falling speed and includes a condition to reset its position when it reaches a certain point on the y-axis, simulating the sprite touching the ground. The code is designed to repeat the sprite's actions indefinitely.

Uploaded by

judeperesso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2.

This enables the sprite to go to


1. This is always the
a random position on the screen
first block of any code! Sprite Falling

5. This specifies that the


3. This specifies sprite will fall at a speed of
where the random -5 (it has a minus at the
position should be front because it is falling
on the y axis down)

7. this condition within the if


4. This shows that the
then loop states that if the
sprite commands
position on the y axis is equal
from now onwards
to -170 then it needs to go
will repeat forever
back up to a random position
on the 175 y axis line.
Please note that -170 is the
6. This shows that if a bottom of the screen.
condition is met, then Therefore this is equivalent to
something will happen the sprite touching the ground

You might also like