How do I make a player invicible? capx attactched, more complicated because of the events.

0 favourites
  • 9 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi, Thanks for any help.

    I read a post in construct 2 and it was mentioned to use a variable to make a player invincible. I have set a global variable of invincibility but unsure how or where to add it to the event? Any guidence would be fab..

    Thanks

  • So if you want to make your player invisible when your live = 0, you can add it in action when your live = 0, set player invisible.

    Btw, you can shorten your events when set animation frame for your healthbar by doing this: Set animation frame to lives

    And move it up to the function.

  • Hi Maverick.

    I ment invincible after the player/ball gets hit.

    Which event to I use?

    Thanks for the tip. I did try moving that event to function bit. But for some reason it didn't work. I spent so long on the health bit and got super confused. I will go back to it because plinkie showed a good way.

    Ta bud

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, misreading.

    This is what I did, I use a boolean variable to set the player is invincible or not:

  • You are a good dude maverick. Appreciate the time you put in to help. Will be adding you to the credits.

    I was thinking of a Boolean. I see how that works.

    I'm tweaking my first level. If you want to play it, let me know. Be good to get feedback.

    :-)

  • You're welcome.

    My pleasure to play your game and give feedback :D

  • What's the best way to send you the game?

  • you can send me through email max.pain.9x (@gmail.com)

  • I use the behavior Flash and set the player to flash for however many second after getting hit, and before any collision check to hurt the player I add "is player flashing" and negate it, so that if the player is flashing, he can't get hit.

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