PyGame Platform

From TRCCompSci - AQA Computer Science
Revision as of 11:18, 5 July 2018 by Admin (talk | contribs) (Created page with "This will show you how to create a platform game using a tiled map, and rectangular based collision detection. =Create Map= ==Tiled== You will firstly need to install the Til...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This will show you how to create a platform game using a tiled map, and rectangular based collision detection.

Create Map

Tiled

You will firstly need to install the Tiled program from the website and link below. In college the Tiled executeables are on moodle, under project, technical skill, monogame, and tiled. I have also added links to other tutorials for using Tiled.

Tiled Website and Download

Tiled Map Editor

Tutorials for using Tiled

Offical Tiled Tutorials

Tiled Basics

Tiled Youtube Playlist Series

Written Version of Above Tutorials


New Tiled Map

You will need a new tiled map, the tile size in the screen shot is 128 pixels, in the end i actually changed this to 32 x 32 and resized the tiles accordingly:

Plat new map.gif

Add Tile Set

Now your map is created we need to add a tile set:

New tileset.gif

I would always recommend you make sure to choose embed and based on tileset image:

Draw Your Level

Now you have a tile set build a simple set of platforms. You should rename the layer to something like Tiles:

Plat simple map.gif

Add Player Object

Now you have a section of platforms, we can now set the position of the player. This will also be the object moved by the code and player input. So insert an object layer, and then use the rectangle tool to create the object. My final player was 60 pixels high and 40 pixels wide:

Plat player object.gif