Shield Action (invincibility That Is Not Time Limited)

Discussion in 'How Can I...?' started by techvalley, Dec 20, 2016.

  1. techvalley

    techvalley Boxer

    Joined:
    Dec 15, 2016
    Messages:
    4
    Likes Received:
    0
    Hello everyone,

    I've been reading the forum for a while, but this is my first post. How can we build a protective shield feature for our game?

    The goal is to have invincibility that is not time limited, but hit limited. The character would activate the shield, it would stay active as long as the character doesn't get a hit. When the character is hit, the shield would break. The second hit would kill the character.

    Thanks!
     
  2. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Hi, welcome to the forum!
    Add a Heath component to the character and set health to 2. Then trick is that the character's Default Animation is the character with a shield on it, and then the Damage Animation on the Health component would be the normal character sprite with animation speed 0. So when your character gets first hit its health reduces from 2 to 1 and at the same time sprite changes to shield lowered, then at next hit your character dies...
     
    teeny-weeny likes this.
  3. techvalley

    techvalley Boxer

    Joined:
    Dec 15, 2016
    Messages:
    4
    Likes Received:
    0
    Thanks @trudnai !

    In this case the character would always start with shield active. We can add an enemy with 1 damage to every first scene to make the character lose the shield before starting the level. But we're trying to make the shield a power up that can be purchased with in game currency.

    I couldn't find an action that would increase the health of the character that might be used to activate the shield for in game currency. Am I missing it?
     
  4. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    I see, then you need to do the powerup with an Action. The Action has an Action Animation which you can choose to have that Character Overlay, and on that you can add a Character Bullet object as a shield.
     
  5. techvalley

    techvalley Boxer

    Joined:
    Dec 15, 2016
    Messages:
    4
    Likes Received:
    0
    Thanks a lot @trudnai !

    I've been trying implementing your idea for few hours, the problem is: Bullet won't kill the enemy unless it has spawner. When it has a spawner, it just stays where it is spawned and won't follow the character. I'm attaching two zipped bbdocs that shows the shield and spawner behavior.

    How can we make the spawned object follow the character, or any other workaround ideas?
     

    Attached Files:

  6. uily420

    uily420 Boxer

    Joined:
    Jan 21, 2018
    Messages:
    1
    Likes Received:
    0
    Hello, I have exactly the same problem.
    Is there any workaround for this problem?

    Or other ideas to build a shild witch follows the char and absorb all enemy bullets (not invincibility)?
     
  7. niketanbalar21

    niketanbalar21 Boxer

    Joined:
    Apr 6, 2018
    Messages:
    31
    Likes Received:
    3
    hello i am use also shield but there is problem in character onces shield is active then character touch enemy so character moves not a stable there position
     

Share This Page