Lose a live when killed by enemy

Get help using Construct 2

Post » Wed May 29, 2013 10:00 pm

I`m wondering how I can make the player lose a live when he get killed by a enemy. Heres the capx:

http://www.dropbox.com/s/sakwfsv3hwe7itz/AlexTheKidInTheMiracleWorldRemake2.capx

I tried with global and instant value, but nothing works.
Hope someone can help me out! Aasmund2013-05-29 22:08:32
System:
ASUS rog G550JK - 12GB ram - Nvidia GeFroce 850 2GB
Constuct 2 personal
B
6
Posts: 28
Reputation: 781

Post » Wed May 29, 2013 10:10 pm

First off, you don't want to reset your global variables unless it's game over.

Start off by setting your global variable LIVES = 3
Then when the hero gets hit, remove one from LIVES and update the text box.
After all three are gone, game over.

See this updated capx
https://www.dropbox.com/s/ouizqwd4kp87f24/alexkidd.capxArcadEd2013-05-29 22:11:25
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Wed May 29, 2013 10:15 pm

Thanks, this really helped :D I was struggling all day with this, before I decided to make the post. By the way, this is a little off-topic, but I`m also have a second problem. The player dont start on the texture-ground, but on the layout "floor".
System:
ASUS rog G550JK - 12GB ram - Nvidia GeFroce 850 2GB
Constuct 2 personal
B
6
Posts: 28
Reputation: 781

Post » Wed May 29, 2013 10:34 pm

Your Hero sprite is a 2 frame animation. The collision box on both frames doesn't match up, take a look at the collision box on frame 1.

That's your answer ;).

B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Wed May 29, 2013 10:41 pm

@Aasmund ... mega embarassing.. I don't have a license yet, so I can't save it.

However; http://db.tt/YoECH77x

I believe it has either:
-Something to do with the origin of ALL blocks (grass and solidjumpblock)
-Origin (base.. bottom of) the character...

Solutions:
-Try a new block from scratch
-New character sprite


I will do both of these in the next half hour.
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Wed May 29, 2013 10:42 pm

@ArcadEd WELL YOU WEREN'T THERE WHEN I WAS TYPING MY POSSIBLE ANSWER.


If his doesn't work, check mine.
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Wed May 29, 2013 10:47 pm

@Sulli
Haha, I hate that!
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Wed May 29, 2013 10:49 pm

@ArcadEd
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Wed May 29, 2013 11:17 pm

Ah, I never thought of the collision boxes
Again, you guys have helped me very much. Now I just need the enemy to flip around when he has hit the questionmark-box. I have re-made the texture myself in Photoshop by the way :)
System:
ASUS rog G550JK - 12GB ram - Nvidia GeFroce 850 2GB
Constuct 2 personal
B
6
Posts: 28
Reputation: 781

Post » Thu May 30, 2013 11:59 am

@Aasmund tag us in if you need a hand again, I'll try and help
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Next

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], Unconnected and 20 guests