0 Favourites

2 questions (platform)

This forum is currently in read-only mode.
  • First and most importantly, what command do I give to make a sprite follow my player (I want it to walk up to me and start punching.) I've tried multiple things but I cant seem to get it to follow me properly (it's a platform game by the way.)

    Secondly, if I wanted to have a health bar visible, would I have to create a sprite of each possible health amount (full health, half health, no health, etc.) and just have Construct replace the health bar each time the character is hit while reducing private variable points? Is there an easier method?

    Any help is appreciated.

  • Here's a small example that shows how to make simple health bar and very simple follower:

    http://www.mediafire.com/?m3dizm1jezi

  • With regard to a health bar you have two choices:

    1. Make a sprite with the action spot at the left, then decrease the width (so if it was 200 pixels wide, you could just subtract 2 for every health point gone).

    2. Make an animated sprite and set the frame manually.

  • Or, if your health bar is going to have some kind of patterns/images that you don't want to be squeezed by shrinking the sprite, you can make it on its own layer and make another sprite with erase effect to limit how large part of the bar is visible.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • If that's the case, the tiled background object has a set width so you can safely set the width without ruining the image.

    However if it's a full image Drasa's erase solution is the way to go.

    Let us know what you're planning .

  • Thanks a lot for the tips. I'm going to try the tiled background method & see how it looks.

  • In my Platform School tutorial, starting with lesson two, there's a health bar of hearts up in the HUD. They're set up like Rich described for a reason... when it comes time for adding or reducing health all you have to do is + or - 32 pixels from the width of the health bar

    Or

    +Always
       -> healthBar: Set width to global('playerHealth')*32
    [/code:2ydtzvlw]
    
    But that's going in a future tutorial
  • There is another issue that I need help with also. I have 2 private variables (health & mana.) My "mana" is set to regenerate +1 every 1 second. Let me explain the problem... ok lets say I set "c" to subtract 20 mana from the player and the player has 20 mana TOTAL. If I use "c" it makes the player reach zero mana BUT if I use it AGAIN the player goes to NEGATIVE 20 and if used AGAIN it goes to NEGATIVE 40 and so on. How do I set mana to NOT DECREASE if the player does not have enough to use?

  • In my Platform School tutorial, starting with lesson two, there's a health bar of hearts up in the HUD. They're set up like Rich described for a reason... when it comes time for adding or reducing health all you have to do is + or - 32 pixels from the width of the health bar

    Or

    > +Always
       -> healthBar: Set width to global('playerHealth')*32
    [/code:3ca6p33m]
    
    But that's going in a future tutorial 
    

    Yea I saw your platform school tutorial. Its explained EXTREMELY well. Now that I understand the health bar its simple thanks.

  • In the event where the subtracting happens, "'c' is pressed" or something like that, you must add an additional condition to test whether you have enough mana! For skill requiring 20 mana, click "insert new condition" on the menu in event editor and test if private variable 'mana' is 20 or greater.

  • In the event where the subtracting happens, "'c' is pressed" or something like that, you must add an additional condition to test whether you have enough mana! For skill requiring 20 mana, click "insert new condition" on the menu in event editor and test if private variable 'mana' is 20 or greater.

    Worked perfectly thanks. I messed up because I put mana 20 or greater on "animation is playing" which is a sub event of "c" instead of putting it DIRECTLY on "c"

  • Can someone please reupload this file?

    Ith the only one i can find, but the link is dead

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