Four problems!

0 favourites
  • 3 posts
From the Asset Store
********* Suv four by four game sprite **************
  • How can I add health and if you touched a solid enemy, you lost your health. And also, how to add collectable coins and add it to the score tab. AND (Final and) how to make if you fell down you go back to the main menu layout. PLEASE HELP!

  • Hi, welcome to Construct 2! These are all easy things you can learn by reading the manual and the tutorials on this site, particularly about global variables! Here is a good beginners guide: https://www.scirra.com/tutorials/37/beg ... t-2/page-1 In particular the section called "Keeping score" will help you!

    Good luck!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • How do you want to do the health ? sprite or variable text.

    If you are doing Sprite based for health then just make animation of 5 frame of what ever image you want to use but maker sure its like this for frame 5 ++++ like as in four of the same thing and on frame 4 +++ make three of the same thing and again for 3 and 2 but leave the last one blank all frame must have the same size frame. and have it start on the sprite's property on frame 5. And your code will be something like this Player collide with enemy -> on health animation set frame number to Self.current frame-1. (what this does is that when you hit your enemy then your health animation since it is set on 5 it will be at 4 because Current frame is at 5 and we added in to subtract 1 which is 4.

    If you are doing variable based then on player sprite add in a variable to the player and name it health and set it to 100 this is going to be your max health point. Next you want to code in the player collide with enemy and then subtract from player variable health by 10. And this will give you a health of 90 after first and then again at 80 and so on.

    Now for the collection of coins you will want to make a global variable and call it coin and make sure that it is number and it's number is at 0, and not on text variant. next you want to do player collide on coin to system add to global variable coin + 1

    If you wish to view the coin or as a score then its just a matter of adding in a textbox object and coding in this Every tick-> textbox object , set text to the global variable name Coins. no " " do not use that.

    and if falling down then you want to add in a sprite and lets call it falling check. and do this code if player overlap the sprite " fallingcheck" then system go to layout "main menu"

    This is just one easy example now everyone has their own takes of how they want their game to function and take in to account that not every game uses the same thing. The best way to know what you want is to play other game and figure out how they did it and read up tutorials section for more.

    Oh and learn to make mistakes because if you dont you will not figure out how to solve debug issue.

    If you have any more question feel free to message me, I'll try to help as much as I can.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)