Chapter 6. Onto the Next Platform...Game

In this chapter, we are going to look at making our next game! This is going to be based off a classic game, Super Mario Bros. Yes, that's right! We are going to look at making a platformer, a genre made famous and popularized by the famous plumber and the big N. In this chapter, we will look at reusing everything we have learned to give us a head start, and then we will get introduced to a new tool named Tiled—a tile map editor to help us build a simple level. We will then take the output generated from that tool, and import it into our game using the Tile Map API that LibGDX has. Next, we will add our character and introduce collision detection between our character and the tile map we have. Finally, we will add a simple collectable that our character can collect while traversing our new world.

So, get ready to make our next game! We will cover the following topics in this chapter:

  • Why and what is a platformer?
  • Reusing what we already have
  • Tile maps – introducing tile map editor
  • Introducing Pete
  • Collision detection revisited
  • Adding a collectable

Why and what is a platformer?

Platforming is a classic gaming genre and concept. So, it makes complete sense that we should look at it. Every gamer will have played one at some point, jumping through the levels, collecting power ups, and defeating the foe with the aim of getting to the end.

Before we dive in, I feel we just need to cover what a platformer is, just in case there are people who are unaware.

A platform game usually involves the player character jumping through a game level, essentially going platform to platform, dodging obstacles, and avoiding traps, such as falling off the edge and out of the game. They can range from simplistic affairs to complex efforts where advanced concepts are involved, such as racing against a clock, having the player perform double jumps or wall jumps, or negotiating movable platforms.

Traditionally, a platform game has the player traveling from the left to the right of the screen in a linear fashion. The screen will follow the player in what is known as side-scrolling, allowing the level to be larger than the screen itself.

To start with, our game will be self-contained on the screen. We will look at creating a side-scrolling game in the next chapter.

Introducing Pete the platformer

Our new game is going to star our new character Pete, in what we will call Pete the Platformer.

Introducing Pete the platformer

Pete will have full movement from the left to right, as well as jumping.

..................Content has been hidden....................

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