"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 ImageImage
B
166
S
49
G
154
Posts: 8,103
Reputation: 100,227

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
89
S
30
G
95
Posts: 5,156
Reputation: 63,448

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! (but not play them)" Construct Classic - Examples Kit
B
108
S
38
G
17
Posts: 2,172
Reputation: 18,964

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