Chapter 7. Game #6, At The Docks

Got pushed around when you were younger? Well, now it's time for payback! Not exactly against the bullies from your school times, but in Game #6, you are now working in a storage area at the docks. Your goal is to push the crates to the correct locations in storage. Someone just dropped them where they are now and it is up to you to finish the job they started. Start the engine of your machine and push these gigantic crates to their target positions. But be careful, you can only push them, not drag them.

Game #6 will be At The Docks, a Sokoban clone. For anyone who doesn't know the Sokoban kind of games, here is a link that explains them: http://en.wikipedia.org/wiki/Sokoban.

The game maps will be made of small tiles. The design of a map will be stored in simple text files, which we will read into the game at runtime. As we are targeting the Xbox 360 platform here, we will control the player's machine with the control pad.

In this chapter, you will do the following:

  • Read joystick input
  • Do collision detection via Box2Box collision checks
  • Use LoadString to read game map data
  • Create an XNA application

So, let's get on with it...

Frameworks and modules used

For our game, we will use the fantomEngine framework (found at http://code.google.com/p/fantomengine/). Why? Well, it was made for this book and it will shorten our development time tremendously.

The minimum version for this chapter will be 1.30. fantomEngine imports the Mojo framework (that is the heart of Monkey) and provides all the major functionality. The fantomEngine framework makes it easy for you to organize your game objects, use layers, and provide a lot of automation.

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

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