[Solved]Stop shooting in all directions

Get help using Construct 2

Post » Fri Feb 14, 2014 10:14 am

Hello Guru's,
I need a bit of help dealing with some events to stop my player from shooting in all directions when the fire button is pushed. I currently have it set to shoot in four directions using the arrow keys to fire ie: pressing upArrow shoots 270deg downArrow shoots 90deg etc. The player uses the WASD keys to move. Now onto my issue. I have been learning about using a delay on the fire mechanic to allow for my player to simulate loading a round into the chamber. Upon implementing this, I now have an issue with when you hold down 2 keys simultaneously, the player will shoot in both directions. This is impractical for how I would like to use it and I have been struggling trying to understand this for about 6 hours now. As I mentioned in my introduction post, I was a soldier for 12 years and this is my first project other than the tuts I have taken to familarize myself with things. Please take it easy on me I have provided a screen capture of the events I am using and can provide the cap if needed. Need some help on this one guys my NOOB brain just cant understand what I am doing wrong. I have tried using Local vars to simulate a boolean but no luck please let me know if I am on the right track here Ladies and gents


http://i.imgur.com/sf8DrC8.png

Respectfully,
~NiteNitestalker2014-02-14 18:36:01
B
9
S
1
Posts: 6
Reputation: 453

Post » Fri Feb 14, 2014 10:51 am

Well one way would be to make variable "shootDirection" for the player and when pressin down set 90 etc. And then use or condition.

when right pressed
-or-
when down pressed
-or-
when left pressed
-or-
when up pressed

->

Spawn bullet to player
Set bullet angle to shootDirectionKatala2014-02-14 10:52:58
B
34
S
9
G
3
Posts: 517
Reputation: 5,246

Post » Fri Feb 14, 2014 2:28 pm

Thank you for your help Katala but I am unsure I understand what your implying. Excuse my noobness :D. I think I have tried what you are suggesting.. This setup still does not work. I feel like I am doing something wrong, or I am just missing a step.I have also included a screen capture of what the player is doing when you hold down all the arrow keys. You can see that he is shooting in all four directions. Your help is greatly appreciated. Thank you again

http: //i.imgur.com/P6NWM0S.png

http: //i.imgur.com/j8tKWQE.png
~Nite
B
9
S
1
Posts: 6
Reputation: 453

Post » Fri Feb 14, 2014 3:15 pm

Sorry my explanation was't the best. I can't open your images but I took one from what I mean.

Something like this

B
34
S
9
G
3
Posts: 517
Reputation: 5,246

Post » Fri Feb 14, 2014 3:52 pm

Katala you are the man , such a simple solution I was over thinking and made this way more difficult then it should have been. You rock man
B
9
S
1
Posts: 6
Reputation: 453


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests