Falling/Scrolling Object Algorithms

rocketIn many arcade video games objects are flying across the screen (either vertically: falling objects, upcoming cars in car racing game) or horizontally (e.g. pipes in Super Mario or flappy bird, cars in Crossy Road).

In frame based games, motions is often implemented by positioning sprites on the screen using (x,y) coordinates and applying a velocity vector (Vx,Vy) to each sprite to indicate the direction and speed of the sprite.

Let’s review the algorithms used to implement three types of motions:

  • Vertical Scrolling: Falling objects (e.g. Catch the Fruit game)
  • Horizontal Scrolling (Right to left gliding pipes in Super Mario)
  • Combination of both Vertical and Horizontal Scrolling in the game of Space Invaders

Vertical Scrolling: Falling objects


Horizontal Scrolling:


Space Invaders: Aliens Motion


Did you like this challenge?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 6

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: