[SOLVED]Bullet Direction

Get help using Construct 2

Post » Wed Jan 04, 2012 9:19 pm

Hi, I'm new to Construct. I've gone through most of the beginner tutorials but I still can't figure this out!

I have a basic platformer. The character has the platform behavior. The bullets work but will only shoot one direction no matter what.

Example: If the character is facing right, the bullets shoot right. If the character is facing left, the bullets shoot right. @_@

I thought I could fix this with some kind of check when the bullet button is pressed, but I just can't figure it out.

Any help would be extremely appreciated! fwade872012-01-04 21:38:24
B
5
G
1
Posts: 13
Reputation: 659

Post » Wed Jan 04, 2012 9:24 pm

If you're using the bullet behavior just set the bullet's angle to the player's angle.
B
134
S
42
G
24
Posts: 5,957
Reputation: 29,841

Post » Wed Jan 04, 2012 9:27 pm

Or set the angle of the bullet according to if the sprite is mirrored or not.
If mirrored => 180, if not => 0

This should do the trick.

There's at least one example in the how do I FAQ but I can't remember if it is up to date or not.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
207
S
70
G
32
Posts: 6,306
Reputation: 48,683

Post » Wed Jan 04, 2012 9:27 pm

How exactly would one do that? I'm checking the bullet behavior setting and the only option is "Set Angle - Yes or No".

Would I need to do this with an action?

Sorry for my silly questions.

EDIT: I didn't see the reply above this one, let me check it out! Thanks for the help guys.

OK, I found the help I needed: http://www.scirra.com/forum/platform-game_topic46666.html

Seems this has been asked before. Sorry!fwade872012-01-04 21:29:29
B
5
G
1
Posts: 13
Reputation: 659

Post » Tue Mar 31, 2015 11:16 am

This seems like the most appropriate place to post about bullet direction...

I set the angle of the Bullet to 180 degrees but its behaviour wasn't remotely as expected.

Whether or not the bullets are fired at 180 degrees seems to depend on how rapidly I press the shoot key (space-bar). E.g - if I press the space bar only after the previous bullet has disappeared from the screen then the bullets are fired at approximately 45 degrees, but if I press fire again before the bullet is completely off screen then it fires out at approximately 135 degrees and will only fire at 180 degrees if the space-bar is pressed rapidly within short duration between presses.

Does anyone have any idea as to why this could have happened?
B
1
Posts: 1
Reputation: 127


Return to How do I....?