Chapter 11. Using X and Y coordinates to make a simple platformer

 

In 1982 the world met Pitfall Harry, and the great platformer tradition was born. Activision’s game has a little pixel man jumping over rolling barrels, landing on crocodile heads to cross lakes, and climbing down ladders to get to a second, underground level that runs parallel to the main level of the game but contains scorpions that can stop Harry in his tracks. Jumping, landing, racing, and collecting are the hallmarks of the platformer genre. Think of Pitfall as a jumping puzzle game or video obstacle course—one that would challenge even an American Ninja Warrior. Harry has to leap over rattlesnakes and land on the other side. He leaps over holes in the ground, leaps up to grab onto a vine, and leaps over the scorpions when he’s underground. He’s also racing against a clock to collect treasure. Harry only has 20 minutes to collect all the gold and silver bars or diamond rings scattered across the game.

Beach Blast is a simple platformer, so you’re not going to focus on time limits or treasure collecting in this game (though you will in the next platformer, School Escape). Instead you’ll focus on a single idea shared by every platformer on the market, from Pitfall to Leo’s Fortune to Geometry Dash: simulated gravity.

Preparing to program

 
 

Programming Beachy Buffy

 
 
 

Answer This: What is Velocity?

 
 
 

Answer This: Why Use Strange Capitalization for the yVelocity Variable?

 

Programming the sandcastle

 
 

Programming the crabs

 
 
 

Programming the vine

 
 
 
 

Programming the odds and ends

 
 

Troubleshooting your game

 
 
 

Learning in action

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage