SHIELD BAR WITH HEALTH BAR

0 favourites
  • 5 posts
From the Asset Store
Versatile shieldpack, usefull for protecting ships or buildings, area-forcefields, creating shockwaves ...
  • Hello

    I am sorry if this question was asked before, but I couldn't find any solution to my problem.

    I am a beginner and I am making my first game despite of that fact I have passed the beginner tutorial and I am familliar with the basics.

    So, I want to make sort of turn-based space tactical game so you have two ships fireing at eachother in turn-bassed battle and you have commands to issue to your ship., seems like advanced and difficult game to make but I want to do that.

    Anyway my problem is making 3 bars that represents "ship's" health status

    • first bar represents shield
    • secound bar represents armor
    • third bar represents Hull

    what I want to do is when "enemy ship" is firing you first loose your shields than when shield comes to zero you start losing armor and aventually when armor is zero you start losing hull and than when hull is zero ship gets destroyed.

    I also want my shield to slowly regenerate over time.

    So how can I do this to have three bars representing health but they will decrease one by one shield first than armor than hull?

    Sorry for bad english it isn't my native language.

    Best Regards

  • The easiest way would be to use 3 Progress Bars. Set their "Max" properties to 100.

    I'd probably set 3 global variables (Shield, Armor, Hull) to 100 on start of layout in your event sheet.

    Then set each Progress Bars "Value" property to each respective global variable.

    Then place with these Actions on your event shit:

    System > Every 3 seconds > Variable: Add to > Shield > 5

    Make a clickable object to reduce the health:

    Create Object > txtAttack > = "Attack" as Text

    Misc Event:

    Mouse> Click > txtAttack > >>> System > Variables > Subtract 20 From > Shield

    System > Variables > Compare Variables > Shield is less than or equal to 0 > .... System > Variables > Subtract 20 from Armor

    And so on and so forth...

    That's how I would start it. But, like you, I am also a novice... just noticed you haven't received an answer yet.

  • I whipped up a sample capx. To damage your unit, click over the blue box. The bars represent Shields, Armour, and Hull, respectively.

    capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should check out

    FTL.

    As you can see there are several layers of shields to get through and the programmers only modified the Opacity of the initial Shield ellipse. Check it out real good game.

  • Thank you for your answers the help is much appreciated.

    faulknermano: Your file helped me much in my project so thank you!

    MPPlantOfficial: my project is simillar but not the same as FTL the shield won't be graphically visible around ships.

    BrandonJAwesome: I will try your solution as well and see if that helps too.

    Thanks once again for help.

    actually I created an sample myself while waiting it seems that it works.

    dropbox.com/s/u5l0p5ea8hlcgz5/practice01.capx

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