How do I die?

Get help using Construct 2

Post » Fri Jul 04, 2014 7:18 pm

Hello,
I have followed the beginner platformer guide and made the player flash when hitting the enemy instead of dying.
I just can't find a way to make it die :lol:
Thank you in advance.
B
7
S
1
Posts: 24
Reputation: 485

Post » Fri Jul 04, 2014 7:36 pm

play a die animation, and when the animation finishes, subtract 1 from some life global value and reset the layout....basically... but of course, it depends on the exact behavior you're after.

-Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Fri Jul 04, 2014 7:57 pm

I added this health instance variables to my Mario character and set it to 1.
But I don't see any response when touching the enemies.
If this pic enough to tell or if it's better to upload a capx file?
Thank you so much.
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 24
Reputation: 485

Post » Sat Jul 05, 2014 6:06 pm

Why would you see a response? You're just setting a variable, you need to make the players sprite react somehow, like play a getting hit animation etc.

cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sat Jul 05, 2014 6:31 pm

PS, have you seen this? You might be able to learn a lot from it.
https://www.youtube.com/watch?v=Plx3eGkp4Z8

cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Mon Jul 07, 2014 1:12 am

Brashmonkey wrote:Why would you see a response? You're just setting a variable, you need to make the players sprite react somehow, like play a getting hit animation etc.

cheers,
Mike


I meant I don't see my character die after setting it. Anyway, I'm going to watch the youtube video. I have a lot to learn.
Thank you.
B
7
S
1
Posts: 24
Reputation: 485

Post » Mon Jul 07, 2014 3:27 pm

You need an action that makes the player play a death animation etc once "health" is less or equal to zero... C2 wont automatically invent an entire death sequence for you.

best of luck,

cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Tue Jul 08, 2014 1:11 am

Brashmonkey wrote:You need an action that makes the player play a death animation etc once "health" is less or equal to zero... C2 wont automatically invent an entire death sequence for you.

best of luck,

cheers,
Mike


Yes I know. I will skip the dead animation for now. Just want my character die, minus a life, spawn in the beginning of the stage.
But I just don't know how to make it die.
I upload my capx file, would you mind to check if my events missing something?
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 24
Reputation: 485

Post » Tue Jul 08, 2014 1:29 am

Player on collision with enemy ----- Subtract 1 from health

Health = 0 ------ Player destroy - And show text "You Lose" Then restart layout
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Tue Jul 08, 2014 4:44 am

A0Nasser wrote:Player on collision with enemy ----- Subtract 1 from health

Health = 0 ------ Player destroy - And show text "You Lose" Then restart layout


Thanks so much! Now I understand the logic slowly.
B
7
S
1
Posts: 24
Reputation: 485

Next

Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, kellehk, TRMG and 25 guests