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 ...
Get Game Development with Rust and WebAssembly now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.