Platformer Engine Week 2

This week we did a little code to finish our engine and spent the rest of the time working on our own platformer games using it.  The code changes we made to last week’s game engine were:

Hit Boxes:

Fixed the platformer so that our character doesn’t get snagged on edges by its whiskers.  This we did by learning about hitboxes. The hitbox is just a costume which is rectangular in shape.  Before we do our animation, we switch to the hitbox costume and after we switch back to the costume we want.

hitbox

Head Bumping:

Fixed the platformer so that we can bump our heads against the platforms without popping up.  This was by adding a couple of lines to the “stay above ground block” sprite to move down if we are touching the ground while moving upwards.

The entire code for the platformer is below:

platform_code

DOWNLOAD THE FULL PLATFORM ENGINE CODE HERE!!!

Example Game: Mentor Dash

Finally Mark showed an example game pulling all the elements in together – “Mentor Dash”.  It has the same code as we covered, but adds a bit of animation, level changes, sound and some sillyness.

mentor_dash

DOWNLOAD MENTOR DASH HERE

There were lots of brilliant ideas from the ninjas on their own games .. looking forward to seeing what you can do!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s