Bullet directions!

Get help using Construct 2

Post » 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
6
S
1
Posts: 8
Reputation: 353

Post » Sat Oct 17, 2015 11:36 pm

if you add something like this?
Image

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

your animation looks like
Image

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
Image
B
65
S
23
G
7
Posts: 1,504
Reputation: 10,894

Post » 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
6
S
1
Posts: 8
Reputation: 353


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 11 guests