Book Image

Learning LibGDX Game Development- Second Edition

Book Image

Learning LibGDX Game Development- Second Edition

Overview of this book

Table of Contents (21 chapters)
Learning LibGDX Game Development Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Game project – Canyon Bunny


To make this guide both easy and fun to read, it makes perfect sense to show you how to plan and develop a whole game project throughout this book. As we now know, planning should be the first step to take on the journey of any new game project.

So, let's begin with the outline:

  • The name or working title for the game will be Canyon Bunny

  • The genre will be 2D side-scrolling jump and run

  • The list of actors are as follows:

    • The player character (can jump and move forward and will be controlled by the player)

    • Rocks will be serving as platforms for the player character and items

    • Canyons in the background (for level decoration)

    • Clouds in the sky (for level decoration)

    • Water at the bottom of the level (which will be deadly for the player character)

    • Collectible items (such as gold coins and feather power-up) for the player

Next, it is always helpful to write down some supporting text to further describe the overall behavior of the game, and how the features should be implemented.

Description of the game

The game world is presented in a 2D-side view to the player. The view will scroll horizontally to the right-hand side when the player character moves forward. The background shows distant canyons and clouds in the sky. The bottom of the level is filled with water and will instantly kill the player character if both get in touch with each other.

The player character will move on and jump over to random rocks, sticking out of the water. The width and height will be different to make the game more challenging. The player is only in control of a jump button, which will keep the automatically forward-moving player character from falling down into the deadly water.

The level will be randomly populated with collectible items consisting of gold coins and feather power-ups. Collecting the gold coins will increase the player's high score. The feather power-up grants the player character the ability to fly for a limited time and can be used by repeatedly pressing the jump button. The player's goal is to beat the last high score.

As a picture is worth a thousand words, creating a sketch based on our outline can help us even more to get a better idea of the resulting game. Moreover, changing a sketch is usually a lot easier than having to change (complex) game code. So, you really want to keep it very simple; just grab your pen and paper and start to draw. If you feel lucky or have some time to spend, you can do something more elaborate, of course.

Here is a mock-up for Canyon Bunny:

The previous mock-up has been created entirely by using vector graphics. Using vector graphics in favor of raster graphics for your sketches can be an advantage as they are infinitely scalable to any size without losing the image quality. However, the final graphics used in games are almost, always, rasterized graphics, simply because vector graphics are costly to render in real time. So, the common approach is to create vector graphics and later on export them choosing an appropriate rasterized graphics file format, such as Portable Network Graphics (PNG) for lossless compression with alpha channel support, or Joint Photographic Experts Group (JPEG) for lossy but high compression without alpha channel support.

For more details, check out the following Wikipedia articles:

There is a free and open source tool called Inkscape similar to Adobe Illustrator. It allows you to easily create your own drawings as vector graphics and is available for Windows, Linux, and Mac OS X. Check out the project's website http://inkscape.org/.