How do I create a health system using hearts?

0 favourites
  • 5 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hey, I'm new to construct 2 and I am creating a platform game for my final year project at university. Instead of using a health bar in my game I would like to use hearts or another shape to represent the character's health. When the character is hit, it will lose one heart. I have found some tutorials on this topic but they were not made for a platform game so I do not know how to apply it to my own.

    Also, is there a way I can combine different event sheets for different levels and title pages?

    Thanks

  • Instead of using a "Healthbar" you should use a sprite with several frames or several animations, where each frame or animation has one heart less than the other. Then when the character gets hit you set the frame to correspond to the amount of lives left.

    Another idea, would be to have one heart-sprite per life, and make it visible or non visible.

    About the event sheets, you can include event sheets in another sheet. See more here: https://www.scirra.com/manual/121/event-sheets

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How would I tell the game to play the next frame if the character is hit again? Right now I have: when character collides with enemy, play frame 1

  • And thanks for the events sheet link, it worked perfectly

  • I have an "outside the box approach"

    Use a black rectangle sprite with with its opacity set to 50% (or whatever) and place it in the black area to the right of the hearts graphic and incrementally change its X value by half heart widths moving it to the left with each damage taken slowly covering the hearts graphic.. moving right as healing done etc..

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