Table of Contents

Bouncing an Object – Python

Example Description
The example demonstrates the bouncing of an object from a bird's eye view in PictoBlox.

Code

sprite = Sprite('Tobi')
import time

sprite.gotoxy(0, 0)
sprite.setsize(100)

while True:
  for i in range(10):
    sprite.changesize(sprite.size()/10)
    time.sleep(0.01)
  for i in range(10):
    sprite.changesize(- sprite.size()/10)
    time.sleep(0.01)

Output