From Dinosaurs to Aliens
Within Replit, you can see the game T-Rex Runner, a copy of a game hosted in Chrome. To play T-Rex Runner:
- Click inside the frame on the right containing the game.
- Press the space bar to begin the game. Your dinosaur starts running. It can't stop, but it can jump over obstacles.
- Press the Up Arrow (⬆) key to jump. The further you run, the higher your score.
Your first task is to change the game's setting from prehistoric Earth to space, complete with aliens and an astronaut. You can do this by replacing the game's graphics.
T-Rex Runner is a sprite-based browser game. All of the graphics ("sprites"), including the dinosaur, obstacles, and background, are contained in one image file called ./images/200-percent/200-sprite.png
:
The image file you're going to use for your version of the game is called ./images/200-percent/200-sprite-space.png
:
As you can see, we've added some color and aliens.
This first lesson includes the following:
- Add the LaunchDarkly SDK for Javascript to the game, so that it can use feature flags.
- Create a "Space Mode" feature flag in LaunchDarkly.
- Modify the game code so that toggling the flag changes the game's graphics.
In the next step, you'll look at the game more closely.