Jump on enemy while press button...

Get help using Construct 2

Post » Fri Sep 09, 2016 1:01 am

Nestorj66 wrote:Exactly :D, and depending on how long the button is pressed jump that differs the height. Sorry if if not understood before, it must be for my bad English. Really thanks for helping me and being the only person to respond :D


You're always welcome, Nestorj66. :mrgreen:

Your English is perfect. I think it was me thinking too fast. :mrgreen:

Ok, so here's the latest example. I hope this was what you were looking for.

https://www.dropbox.com/s/02p7lqxmdpga6 ... .capx?dl=0
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Fri Sep 09, 2016 1:23 am

Yes, more or less well. The problem is when the jump on enemy is finished and jump again, the jump strenght stays, and the idea is that only changes when the player jumps on the enemy.
B
9
S
2
G
2
Posts: 32
Reputation: 1,595

Post » Fri Sep 09, 2016 1:45 am

Check this out. :mrgreen:

https://www.dropbox.com/s/2kulg1btx0jrz ... .capx?dl=0

What was updated

1. Player jumps faster.
2. Player's jump strength varies based on how long the jump key is pressed.
3. Player can jump again after stepping on the enemy's head.
4. Jump strength stays after jump is complete.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Fri Sep 09, 2016 2:17 am

Wow really close @Gmoney . Now the only problem is that the double jump stays
B
9
S
2
G
2
Posts: 32
Reputation: 1,595

Post » Fri Sep 09, 2016 2:21 am

No! Sorry! I add another event when the player on landed disable the double jump. Finally! Thank you so much :D
B
9
S
2
G
2
Posts: 32
Reputation: 1,595

Post » Fri Sep 09, 2016 3:02 am

Well, @Gmoney, there is another problem u.u. If i want to jump on much enemies the double jump only works on the first and not works in the other :C
B
9
S
2
G
2
Posts: 32
Reputation: 1,595

Post » Fri Sep 09, 2016 4:18 am

Hi, Nestorj66.

All enemy units need to have Hitpoints placed above their heads. :mrgreen:

We can do this either by creating separate group of events for each enemy unit we create, or use Families.

https://www.scirra.com/manual/142/families

Here's an example capx file demonstrating the use of a Family named Family1.

I've placed comments in event sheet 1. :mrgreen:

https://www.dropbox.com/s/cca8b1pqv0asy ... .capx?dl=0

The code looks good, but there's a bug.

There are two enemies, but if you step on the one close to the wall first, then the bug will occur.

I think I know how to fix that bug, but I'll need more time to find the answer. :mrgreen:

Maybe another user in the forum can help Nestorj66 with this issue by showing him/her how to pick the correct family member from Family1.

If not, I'll be back with an answer tomorrow. :mrgreen:
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Fri Sep 09, 2016 5:28 pm

I'm surprised no one helped you while I was gone, Nestorj66. :(

Anyway, I ended up spending hours trying to resolve this issue myself and finally solved it. :mrgreen:

Here's the example capx.

https://www.dropbox.com/s/4v7welmk7z2xf ... .capx?dl=0

Explained

1. Enemies get destroyed only when Player jumps on their heads. (e.g. Enemies don't get destroyed when Player touches them without jumping on their heads.)
2. Player bounces off after jumping on enemy's head.
3. Player can double jump to a fixed height after jump is successful.
4. Double jump gets deactivated after player bounces off enemy's head.
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Sat Sep 10, 2016 1:17 am

Really, really thank you so much :D @Gmoney You helped me so much. Finally works just I wanted. Sorry for make you spending hours doing this u.u I didn't want to disturbe you. But really you are the only person that seems to be active on these forums xD. Again, thank you so much. Maybe I'll ask for you to help me if I have another issue xD. But now, really you helped me so much :D
B
9
S
2
G
2
Posts: 32
Reputation: 1,595

Post » Sat Sep 10, 2016 1:29 am

Nestorj66 wrote:Really, really thank you so much :D @Gmoney You helped me so much. Finally works just I wanted. Sorry for make you spending hours doing this u.u I didn't want to disturbe you. But really you are the only person that seems to be active on these forums xD. Again, thank you so much. Maybe I'll ask for you to help me if I have another issue xD. But now, really you helped me so much :D


You're most welcome, Nestorj66. :mrgreen: Oh, no problem at all. I enjoy spending time with C2, and I always learn while looking into everyone's help requests as well.

Please ask me any time. I'll solve the problems for you as soon as possible. :mrgreen:
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Previous

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 28 guests