So far, we've used Corona's support for the Box2D physics system primarily as a collision detector. It's been used in three projects and we've immediately turned off the gravity in every case. In at least one case, most bodies we create are sensors. This project will explore how to use more of the actual physics-based features to build a platform game with gravity and solid floors and walls.
For this project, we will start with a partly completed platform game; it contains all sprites, and a tile map module similar to that used in Project 7, Caves of Glory – Mastering Maps and Zones and Project 9, Into the Woods – Computer Navigation of Environments. We will add physics to this world to create the world interactions that support game play; walls and floors that stop the player, collision detection with enemies that doesn't allow them to actually push the player or cause things to bounce off each other, and climbable ladders. We'll use collision filtering, in combination with sensor body elements, to keep only the physics interactions that are actually useful to us.
You'll start out with working modules to load a map from a file, load characters with sprites and accept control signals for them, supply control events for your character from user input, track score, and recognize level completion. The game implements a simple platformer, where you jump from block to block, score points by jumping on top of enemies to squish them, and navigate ladders and pools of water. The player will move the character to the left-hand side or right-hand side by holding the screen on the desired side, climb by tilting the device backward or forward, and jump whenever they release the screen (including a tap for standing jumps).
This project will address one aspect of the physics module that we've let slide up to this point: multi-element bodies (fixtures in Box2D's internal parlance). We've used them a little in the shooter projects, solely as a way to create concave physics shapes without freaking out Box2D. However, in this case, we'll really go down the fixtures rabbit hole, using different collision filters for different fixtures as well as creating bodies that contain both solid fixtures and sensor fixtures.
The tasks for this project will focus on controlling physics interactions.
18.226.172.200