Movement

Move a sprite using code.

Learning 2Code

In Purple Mash, find and start your 2Do named Move the Balloon.

If you changed some properties, change them back. Here is the list of what we need.

List of balloon properties

Starting to code

Our balloon moves across the screen in a straight line. It would be more realistic if it moved at an angle. Perhaps, going from near the bottom left to the top right.

We can set the angle property of the balloon in code.

Press Run to see what has changed.

Using a timer

It would also be better if the balloon appeared to get smaller as it went up into the sky.

Our timer will change the scale property every second.

More improvements?

Can you think of other ways to improve our animation?

  • What is the best speed?
  • What if you subtract more from scale?
  • How can you stop the balloon coming back round again?