"Jolt" effect?

For questions about using Classic.

Post » Fri Sep 30, 2011 9:59 am

I've been working on trying to come up with a way to create a "jolt" effect when a character shoots in my top down game. I'm not really sure how to describe what I mean, but it's something like the character... erm, jolts backwards quickly on shoot. If you've played Counter Strike 2D, when you fire your gun the sprite of the player jolts back quickly.

I just can't figure out how to do it. Could anyone help me with trying to figure out how to do this?
B
8
S
2
G
2
Posts: 144
Reputation: 1,588

Post » Fri Sep 30, 2011 11:25 am

Mmmm, how about pv= n: system set scroll to scrollx+normalrandom(0,10)?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Oct 01, 2011 4:26 pm

You mean a kickback? It's basically giving the player some speed in the opposite direction as they're shooting. The implementation varies depending on what movement behavior you're using.

Here is an example for a platformer:
Shoot angle=0
Sex player X speed to x_speed - 20
Shoot angle=0
Sex player X speed to x_speed + 20
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Sat Oct 01, 2011 5:49 pm

Rather than move the player, why not use animation frames to move the gun back with image points? I think actually moving the whole player or screen is better left for explosions and rockets only.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun Oct 02, 2011 5:41 am

Thanks for the help guys! I've managed to create a sort of kick back effect via animation, thanks Jayjay!
B
8
S
2
G
2
Posts: 144
Reputation: 1,588


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests