How do I stop a bullet from firing from 2 directions.

Get help using Construct 2

Post » Sun Nov 20, 2016 7:56 pm

Hi there.

I've made my main character fire fireballs when pressing a certain key, but the problem is, when I turn left and if he is standing still, he fires them both directions, left and right. I've tried putting the "Is mirrored" condition, but that doesn't really do anything.

So, what's the problem?
B
7
Posts: 34
Reputation: 345

Post » Sun Nov 20, 2016 10:21 pm

It's impossible to know without looking at the events, could you take a screenshot of that part?
B
125
S
43
G
41
Posts: 849
Reputation: 28,260

Post » Sun Nov 20, 2016 11:48 pm

indeed, screenshot required.
B
34
S
9
G
3
Posts: 206
Reputation: 7,851

Post » Mon Nov 21, 2016 1:10 pm

Message: Vodakman can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Image



For me the image doesn't appear so here's the link for it if it doesn't appear for you guys too:
http://imgur.com/fBAlB9v
B
7
Posts: 34
Reputation: 345

Post » Tue Nov 22, 2016 12:11 pm

Nevermind, I figured it out. Thanks for trying to help me though.
B
7
Posts: 34
Reputation: 345

Post » Tue Nov 22, 2016 2:53 pm

@Vodakman ok nice. btw. you know that you can add sub-conditions? I just checked your screenshot. Try to move the box "13" under box "12" (drag & drop) and clean it up / merge it. You don't have to check if "key is pressed" for each case. This might still work but could easily create problems later or if it gets more complex.

You could do it like this e.g.

is key pressed and fire_allowed = 1 : spawn bullet
--> is mirrored : bullet angle 180
--> else: bullet angle 0
B
34
S
9
G
3
Posts: 206
Reputation: 7,851


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests