Chapter 3. Start Your Engines

In this project, you will learn that things are not always as they appear. Sometimes, it's useful to separate the code and functionality of the game from the pretty graphics. In the project that we will build here, we will separate a player-controlled object from the sprite that represents it. We will also use an invisible collision mask to give the program a much clearer feedback than a regular image.

Mission briefing

With this project, we will recreate a much-loved game series. At the end of the project, you will be able to invite a friend and enjoy the game you've built together. We're going to do a remake of Mario Kart and it will include a multiplayer feature.

Mission briefing

Why is it awesome?

We will look into a very effective and efficient way of separating graphics from programming. Computer code should be as clear as possible. With fancy decorative graphics, this is not always possible. Therefore, we create fancy graphics for the player to see while they're playing, and we'll create another set of simpler graphics for the computer to work with. With only a few scripts, we can tie these graphics together to create a unified experience.

Your Hotshot objectives

We will start by creating some graphics so that we can see what we are doing. Then we will get into some scripting, and eventually tie all the bits and pieces together to create a finished game. In this project, we will deal with the following steps:

  • Drawing a racetrack
  • Creating a kart
  • Building keyboard controls
  • Using a collision mask
  • Dealing with collision events
  • Adding a second player
  • Finishing the game

Mission checklist

We will use some existing bitmap images for this project. We need to edit these images, so an image editing program might be useful. This program could be Adobe Photoshop (http://www.adobe.com/downloads/), GIMP (http://www.gimp.org/), or even MS Paint. It doesn't really matter, as long as you feel comfortable using it.

The following screenshot shows the GIMP editor:

Mission checklist
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.186.83