problem with bullet angle

Get help using Construct 2

Post » Sat Jan 26, 2013 11:05 am

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
B
4
Posts: 9
Reputation: 468

Post » Sat Jan 26, 2013 1:48 pm

There seems to be a problem with your download link. Could you re-upload it somewhere else (like Dropbox)?
B
56
S
15
G
10
Posts: 910
Reputation: 11,972

Post » Sat Jan 26, 2013 2:27 pm

sure here you go: https://www.dropbox.com/s/p2j5rlokbxilxc3/help.capx
B
4
Posts: 9
Reputation: 468

Post » Sat Jan 26, 2013 4:54 pm

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.
B
56
S
15
G
10
Posts: 910
Reputation: 11,972

Post » Sat Jan 26, 2013 6:30 pm

thanks a lot, just how i wanted it :) will use your advice in the future.
B
4
Posts: 9
Reputation: 468


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests