How do I make an enemy bounce when they are hit?

Get help using Construct 2

Post » Sun Jun 07, 2015 3:18 am

I'm still a pretty big novice when it comes to Construct 2 and I don't know if this can be done without plugins or real code, so here's a doodle to demonstrate what I'd like to have happen:

Image
(open the pic in a new tab if it gets cut off)

Basically, when the player hits the enemy, I want the enemy to fly in a parabolic arc (I'd like to be able to set the angle, for different attacks) and bounce when they hit the ground, losing a set amount of momentum for each time they bounce until they are stationary. I'm pretty much lost on how to implement this into my game code wise. If I need a plugin to make it possible/easier let me know and I'll grab it.
B
18
S
9
Posts: 103
Reputation: 1,817

Post » Sun Jun 07, 2015 9:04 am

One simple way without to much coding I can think of would be using the bullet behaviour with gravity..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Post » Mon Jun 08, 2015 8:09 am

Thank you both, through a combination of your posts I got it working with physics and all. My next question is: Is there a way to get the enemy's physics to "pause" for a split second when it hits the ground for a bounce, then continue as it was just to give it a bit more oomph?
B
18
S
9
Posts: 103
Reputation: 1,817

Post » Mon Jun 08, 2015 8:18 am

Although I'm not sure if this would work with physics and I doubt using physics is the wisest decision in this particular case, using the system action set object timescale, for a certain amount of time could get you this effect..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jun 10, 2015 5:49 am

LittleStain wrote:Although I'm not sure if this would work with physics and I doubt using physics is the wisest decision in this particular case, using the system action set object timescale, for a certain amount of time could get you this effect..


Why do you say that? Are there hitches with physics that the bullet behavior doesn't have?
B
18
S
9
Posts: 103
Reputation: 1,817

Post » Wed Jun 10, 2015 7:10 am

All behaviours work different..
Choosing the right one is up to the person creating the game..
Hitches isn't the right word, possibilities and limitations..
In my opinion people use the physics-object in many cases it isn't completely nescessary and often run into issues trying to make it play nice with other behaviours and/or using to much processing power for things that could simply be coded..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jun 10, 2015 8:01 am

CJacobsSA All performance of any given instruction work differently. prefer the right one is up to the individual constructing entertainment software. LittleStain is perfectly right in what he says because depend on person what he or she wants software to perform and how fast.
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Post » Thu Jun 11, 2015 1:28 am

I see! Well, I'll make a branch real quick to test out bullet behavior instead of physics behavior to see if I like it better, I'm sure it won't take too long to find what I like better. Either way, your object timescale solution worked, so thank you both for your help! I appreciate it! :)
B
18
S
9
Posts: 103
Reputation: 1,817


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests