How do I fix my bullet angle?

Get help using Construct 2

Post » Tue May 31, 2016 3:11 pm

My bullets when i face left shoot backwards. Every time I shoot bullets, facing left, after the second shot they all reverse angle. Even if I shoot a bullet while facing right then shoot facing left, they still reverse direction. The only time my bullets shoot normally is when I'm facing towards the right.

Video here: https://www.youtube.com/watch?v=4i304_S4EOg&feature=youtu.be
B
36
S
22
G
2
Posts: 10
Reputation: 4,272

Post » Tue May 31, 2016 3:16 pm

The way I have it set up for my own purposes is:

On Z pressed:
-> Create object <bullet> at player.LayerNumber (player.X, player.Y)
-> Set <bullet> angle of motion to player.Angle degrees

The bolded part is what allows the bullet to have the correct angle and not always shoot to the right. You should be able to apply this to yours.

If that doesn't work (or if you've already done it like that), would you mind posting your .capx file?
Ruby Winds: a top-down adventure game inspired by the Oracle series of Zelda games.
Twitter - Devlog/Site
B
14
S
6
G
13
Posts: 54
Reputation: 7,503

Post » Tue May 31, 2016 3:30 pm

My capx file below
http://www.filedropper.com/wonkybullets

What do you mean by create bullet? does it work if i spawn it from another object?
Thanks for the feedback!
B
36
S
22
G
2
Posts: 10
Reputation: 4,272

Post » Tue May 31, 2016 8:58 pm

Message: SNN135 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Yes, but it looks like your spawning method works as well (since you're spawning it at an image point at a gun).

http://www.filedropper.com/bullets Is this what you were looking for? I modified a couple of things and set the bullet's angle of motion instead of what you had before (note: the way you had it simply changed the angle of the graphic - it did nothing to the direction of the bullet itself).
Ruby Winds: a top-down adventure game inspired by the Oracle series of Zelda games.
Twitter - Devlog/Site
B
14
S
6
G
13
Posts: 54
Reputation: 7,503

Post » Wed Jun 01, 2016 4:17 am

WOW thanks SNN! I need to review this change, maybe I'll learn something for once lol. It feels a bit wrong to just take your changes, so I'll try never to make this mistake again.

Cheers!
B
36
S
22
G
2
Posts: 10
Reputation: 4,272

Post » Wed Jun 01, 2016 4:22 am

OHHH I see what you did there :)

So i needed to take advantage of the bullet behavior on the sprite, Instead I tried to change the sprite graphics shot direction.
Sometimes i forget.
B
36
S
22
G
2
Posts: 10
Reputation: 4,272


Return to How do I....?

Who is online

Users browsing this forum: plinkie, zenox98 and 18 guests