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


scrolling-algorithm-falling-object

Horizontal Scrolling:


scrolling-algorithm-pipe

Space Invaders: Aliens Motion


scrolling-algorithm-space-invaders


Share Button
Posted in Computer Science, Computing Concepts Tagged with:

Our Latest Book

Follow this blog