How do I shoot up and down without changing player's angle

Get help using Construct 2

Post » Tue Jan 17, 2017 1:37 pm

Hi,

in a top down game, my 8-movement Player should be able to shoot up an down without changing his angle to "up" and "down".

I've set the 8-movement to "set angle = no" and mirrored the sprite. But how do I get it to shoot up an down.

Can anyone help me out. Thanks!

Held
B
5
S
1
Posts: 45
Reputation: 463

Post » Tue Jan 17, 2017 2:26 pm

If key [down] is down and key[fire] is pressed, create your bullet and set its angle to 90.
If key [up] is down and key [fire] is pressed, create your bullet and set its angle to 0.

As you can see, the above two events are similar, so you'll want to try and make them sub-events of the 'key fire is pressed' condition, for example.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314

Post » Tue Jan 17, 2017 2:33 pm

But then the bullet which is already fired up immediately changes it's angle if I hit the opposite direction and fire.
B
5
S
1
Posts: 45
Reputation: 463

Post » Tue Jan 17, 2017 3:56 pm

This indicates that you're not picking the correct instance of the bullet to manipulate when you set its angle. It sounds like there's a 'set angle' action on your bullets which doesn't have a corresponding condition directing it towards a specific bullet.

If you include the 'set angle' action in the same event as the creation of the bullet, it will apply to the created bullet. Otherwise, you'll need to specify which bullet you want the angle adjustment to affect.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314

Post » Tue Jan 17, 2017 6:57 pm

Aah, I see. Right now, I'm not having my project in front of me, but I think, in the corresponding-subject lies my mistake. So, I just have to separate the spawning and the up-down-request, right? Will try it tomorrow. Thanks a lot!

Held
B
5
S
1
Posts: 45
Reputation: 463

Post » Wed Jan 18, 2017 12:37 pm

...made subevents, works like a charm.

Thanks again!
B
5
S
1
Posts: 45
Reputation: 463


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 27 guests