Shield power up help?

0 favourites
  • 9 posts
From the Asset Store
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • Hello, i am very new to construct 2 and i am trying to do a shield when the player collides into the shield.

    for 10 seconds it lasts not taking damage while once its over it reverts back to normal.

    i really have no idea how to do this, i hope someone can help me achieve this thanks.

  • Hi,

    You have multiple ways to do this, here is one :

    1) Add a Timer behavior on your character (https://www.scirra.com/manual/167/timer)

    2) Add a Boolean variable on your character named for example canTakeDamages and set it to true by default.

    3) On your character damages logic (the conditions / events where he takes damages) add the boolean condition, so by default he can take damages.

    4) On collision with the power up, set the boolean to false, and start a time "onShieldOff".

    5) Create a new condition "On timer" with the tag "onShieldOff", and add an action for the character where you set back the boolean to his original value.

    Maybe I missed something but you have the idea !

    (You should post this to the "How do I... ?" forum <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Thanks for the help, mate.

    I am really trying to learn things since, I new to construct 2. Would you mind sharing a little example how would you execute it, I hope is no bother, thanks. Either way thanks once again mate.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should try by yourself or you ll never get C2 logic. At least try something and if it doesn't work post the capx here.

  • so this is what i got, it doesn't seem to work unless i did something wrong..

    everything seems alright

    dropbox.com/s/3c6bv6u5knpg86r/powerup-example.capx

  • Try this !

    https://www.dropbox.com/s/qsznfal92abml ... ample.capx

    <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Deadartcore can only post plain text URLS when they have 300 rep. 1 URLS removed. Why?

    Try this !

    thanks, mate i appreciated it great help. one last thing i added a set animation to "shield" when player collides to shield turns him yellow but how do i remove the animation to original aspect to blue after the 10 seconds.

    sorry for asking so much.

  • You changed the player animation frame ? Or the shield is rotating around the player ?

    If it's the frame when the timer is over set it back to the original frame and if you are rotating the shield around the player you can simply destroy the shield.

  • You changed the player animation frame ? Or the shield is rotating around the player ?

    If it's the frame when the timer is over set it back to the original frame and if you are rotating the shield around the player you can simply destroy the shield.

    Thanks for the help, just made it work i just set animation to "shield" when on collision and when timer is gone set animation to "default" now it works flawless. thanks mate.

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