Page 1 of 1

problem with bullet angle

PostPosted: Sat Jan 26, 2013 11:05 am
by DeadlyCheese
Hey, basically i'm experimenting with making a continuous running platformer game where incoming amounts of enemies spawn. The problem I am having is with the bullets. I want it so that the player can only face forwards so what i did was make it so that the players arm cannot go backwards when the mouse (which is used to aim) is behind the player. I have been able to make it so the arm doesn't go backwards however the issue i'm having is that the bullets will still fire behind the player if the mouse is between a radius of 90 to 180 degrees from the player. My method seems to work when the mouse is between 180 to 270 degrees however. If someone could look at my capx and explain what the problem is, i'd be very grateful :)

Im still very new to the program and experimenting but hopefully you can understand what im trying to do :P Event 11 and 12 is what im trying to use to force the direction of the bullet to directly down and up.

Capx: https://www.dropbox.com/s/p2j5rlokbxilxc3/help.capx DeadlyCheese2013-01-26 14:27:33

Re: problem with bullet angle

PostPosted: Sat Jan 26, 2013 1:48 pm
by GeometriX
There seems to be a problem with your download link. Could you re-upload it somewhere else (like Dropbox)?

Re: problem with bullet angle

PostPosted: Sat Jan 26, 2013 2:27 pm
by DeadlyCheese
sure here you go: https://www.dropbox.com/s/p2j5rlokbxilxc3/help.capx

Re: problem with bullet angle

PostPosted: Sat Jan 26, 2013 4:54 pm
by GeometriX
You had already done most of the work - setting the arm to follow the mouse within certain constraints. Repeating that process to set the bullet angle threw out most of that work though; setting the bullet to use the arm's angle when spawned is the way to go.

Updated capx.

Re: problem with bullet angle

PostPosted: Sat Jan 26, 2013 6:30 pm
by DeadlyCheese
thanks a lot, just how i wanted it :) will use your advice in the future.