Chapter 6: Creating an Endless Runner
Red Hat Boy (RHB) can run, jump on a platform, and even crash into a rock and fall over. But once he starts running to his right, he just goes off the screen and is never seen again. There isn't much to it, and if you wait long enough, the game even crashes with a buffer overflow error. In this chapter, we'll make our game truly endless by generating new scenes as RHB runs that contain new obstacles and challenges. They will even contain randomness, and it all starts with RHB staying in one place! It's a real trick.
In this chapter, we will cover the following topics:
- Scrolling the background
- Refactoring for endless running
- Creating a dynamic level
By the end of this chapter, you'll have a functioning endless runner and be able to create obstacles for RHB to hop over and slide under.