Platform game Start to Finish

3

Index

Attached Files

The following files have been attached to this tutorial:

.capx

demo-game.capx

Download now 5.33 MB

Stats

8,942 visits, 18,607 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 22 May, 2018. Last updated 19 Feb, 2019

Create new Layer, and name it HUD (head-up display), set Parallax to 0, 0. Create 6 Textboxes, and name it as;

1. txtScore

2. txtNumAmmo

3. txtPlayergethit

4. txtGoldbars

5. txtHealth

6. txtMSGBox

Place all your text boxes at the top left-hand corner on HUD layer, because when you run your game HUD parallax is set to 0,0 all those text boxes will be shown on gameplay screen.

1. Set size of text boxes, txtScore, txtNumAmmo, txtPlayergethit, txtGoldbars, txtHealth, to;

2. 96 x 28

3. txtMSGBox size set to 200 x 48

In our Global Event Sheet create Variable, and name it MSG as text;

Whenever you want any message to be shown on game screen, just use variable MSG, and pass messages with, example if Player collide with Door, Player has no Key, Message we display will be “You need the key”, or whatever you think. Once we put this message in variable MSG all we do is set txtMSGBox to VISIBLE, for how long in seconds, then make it INVISIBLE again, that is all. The very handy way of doing this.

Insert this in our Main Game event sheet;

Here what we are checking, if Player has key door is open, if not, MSG will be shown on screen as “Need Key”, therefore we insert “Need Key” in are variable MSG, next we set property to Visible, set time 2 seconds to be shown on MSG, after 2 seconds will set it to Invisible again. Simple

In Dead_Family I have added all those sprites that should not be shown when end games. Now only one more thing left to do and that is Game over Routine, where Player dies by spikes or Snakes, this is where we need to say Game_Over.

Open your Function Event Sheet and create Function, and name it Game_Over, insert this code below;

If Variable isAlive = 0 we call this function, where we fade our hero, set animation to dead, destroy everything on the screen, the system set MSG variable to Game_Over, MSG set to visible, wait 5 seconds, reset all global variables, Restart the Game.

Please if you find this tutorial helpful, please write some comments, Thank you

.CAPX

demo-game.capx

Download now 5.33 MB
  • 0 Comments

Want to leave a comment? Login or Register an account!