Destroy after animation

Get help using Construct 2

Post » Mon Feb 22, 2016 9:46 am

I changed your cpax a little bit. I hope now it's a bit clearer.
https://drive.google.com/file/d/0B5FlDY ... sp=sharing

But there are still some flaws in it. For example, if you press s for attack, you will attack the whole time. I don't know what you're up to, If you want to stop if you attack or a new running attack animation ect. so it's your decision how to fix that.
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Mon Feb 22, 2016 10:08 am

i know my dude, look i am a newbie in this. just watched tons of videos and stuff.

i dont know whether to attack on the button down or pressed

i also don't know if "enemy destroy animation" should start playing on "s button" pressed or on the "stab animation" playing

i am googling and searching all the time trying to change things but i cant really. there are many tutorials on how to create sprites and objects and bla bla bla, but when my player is running and jumping and i want to perfect this simple game, its hard to find those who shares ideas on how to polish games, you know? most of them dudes are keen on their enemies just disappearing and when the player dies they all just do the layer restart.

my idea is to make this kind of endless runner game with my ninja jumping and killing enemies (there should be different types of enemies, like running, flying, crawling, shooting and bomb throwing enemies). and if u could help me with this stuff would be pretty awesome.
B
4
Posts: 10
Reputation: 224

Post » Mon Feb 22, 2016 10:52 am

and thank you, yeah it's much clearer now my man! only thing is that my "flip jump" animation is not playing, maybe it's because the player is running and jumping at the same time. now trying different actions to fix that ha ha.

its funny how u fixed everything with those variables...
B
4
Posts: 10
Reputation: 224

Post » Mon Feb 22, 2016 1:07 pm

The variables are some kind of states with them you can protect events, like the isDead event.
I changed a litte more in the capx. I use a Timer-Event for the attack, so the states are automatically set back and now the player can only attack once per pressing the attack button. Also the attack animation will now break the jump animation, but it has still some flaws.
https://drive.google.com/file/d/0B5FlDY ... sp=sharing
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Mon Feb 22, 2016 2:51 pm

thanks bro! i really need ur full name so that i could credit u in case i ever finish it and share with people. but really if u re using variables for moving or jumping, why do we need events like IS JUMPING or IS RUNNING?
B
4
Posts: 10
Reputation: 224

Post » Mon Feb 22, 2016 3:04 pm

You don't have it to do this way. You can put most of the code direct in the keyboard events, but this is my way to do it, because I like it clearly arranged and I think it is easier to maintain.
There are several other ways to arrange the code, it's all about personal preferences. ;)
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Mon Feb 22, 2016 10:06 pm

Have you tried the fade out behavior its has a built in destroy you could do is when death animation ends start fade out to destroy. or you could add in a death animation of one frame after death to use for the fade to destroy.
B
52
S
24
G
6
Posts: 391
Reputation: 7,855

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests