# Bullet directions!

Get help using Construct 2

### » Sat Oct 17, 2015 10:43 pm

So I have a top down 'bullet hell' game that I followed one of the tutorials here to build. Worked great at first until I added character selection (player animations) and corresponding bullet animations.

The player is 4 directional but naturally only shoots bullets to the right. When I add something like:
right arrow down : set bullet angle of motion to X angle
left arrow down : set bullet angle of motion to X angle

It changes the direction of the bullet correctly BUT if the player starts off shooting right and then turns left, all of the bullets just shot to the right will redirect and head left. It's actually kind of a cool effect - but not what I want in this game.

Like I said, when the player was one animation the whole thing worked fine but something happened when I added animations that threw it off. Any ideas? I'll add some more info below that may be useful.

Character selection (ctr) is a global variable. Player is set so if ctr = 0 then load a certain animation, etc. Each animation has 4 frames for each direction that correspond to arrow keys pressed. I've toyed around a lot with bullet behavior and 8-directional behavior with no avail. The bullet spawn point is set for each frame to load on the correct edge of the frame...idk, muh brain hurts.
B
8
S
1
Posts: 10
Reputation: 407

### » Sat Oct 17, 2015 11:36 pm

if you add something like this?

If I understood correctly
ptw wrote: Each animation has 4 frames for each direction ...

so..if frame is 0..Bullet angle =0*90=0;...frame 1=1*90=90;...frame 2=2*90=180;...frame 3=3*90=270
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,094

### » Sun Oct 18, 2015 5:32 am

@korbaach - YES! Still took some tinkering but man... I never would've thought to do frame*90 to get the angle. Genius. Thank you so much!

https://media4.giphy.com/media/VgNQdejHFZJdu/200.gif
B
8
S
1
Posts: 10
Reputation: 407