A simple game engine
Drawing shapes, lines, and pixels is all very well, but how do we make them appear to move? We will be using the same animation trick used in cartoons, movies, and other video games, given as follows:
- Draw an object
- Rub it out
- Draw it in its new position
- Repeat steps 1 to 3 fast enough to trick the player's brain that the game objects are moving
- Do all the above while listening for touches on a separate thread
The theory makes it all sound more complicated than it is. Let's make our Pong game and it should all become clear.