Robot Foot Games Helping you improve your games as we improve our own. :)

30May/110

Adding Checkpoints to PSK

Here's a video showing off what the checkpoint system should look like after this tutorial:

Here's the basic rundown of how I set this up. First, we'll add another tile to our list so we can add checkpoints through our text document levels. Second, we'll set up how the checkpoints should work. The most recent checkpoint you've touched will be your current checkpoint. If you know how the Sonic games have checkpoints it's very much like that. When you die you'll be returned to your most recent checkpoint.

In Tile.cs add the following in enum TileCollision:

 

In Level.cs After this line:

Add this:

 

Now find the following:

And change it to this:

 

In ‘private Tile LoadTile(...)’ add this near the others.

 

Now in Player.cs find the following:

And add this after it:

 

Now make sure you add some 'P's to your levels so you can try out the checkpoints. Currently they just use the BlockA0 texture so you'll have to add your own to the Tiles folder and change the case 'P': ... texture argument to match your own checkpoint texture.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.