How do I push my player away from where he's shooting?

Get help using Construct 2

Post » Mon Apr 18, 2016 11:53 pm

Hi Forum,
When my player shoots I want him to be pushed away from where he's shooting, so if he is shooting right he is pushed left from the force.

https://www.dropbox.com/home?preview=game.capx

Thx
I don't think I could ever stab someone, I mean, let's be honest. I can barely get the straw into a Capri Sun.
B
26
S
10
G
7
Posts: 91
Reputation: 6,420

Post » Tue Apr 19, 2016 4:23 am

Hey Potato,

In your shooting events what you can do is add a sub-event that checks if the sprite is mirrored or not.

If mirrored then you can set the sprite X to : Sprite.X-2 (or desired push back amount)
If not mirrored then set it to Sprite.X+2

Depending how the rest of your game works you might have to tweak that a bit to make sure you cant push yourself through walls but it is a solid start.
ImageImage
B
129
S
23
G
7
Posts: 1,077
Reputation: 13,253

Post » Tue Apr 19, 2016 10:54 am

@GenkiGenga thanks, i'll try
I don't think I could ever stab someone, I mean, let's be honest. I can barely get the straw into a Capri Sun.
B
26
S
10
G
7
Posts: 91
Reputation: 6,420


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 58 guests