Different bullets directions based on image number

Get help using Construct 2

Post » Thu Feb 21, 2013 11:46 pm

Hi,
I have 3 images of my player holding his gun.
1. holding it upwards.
2. holding it straight.
3. holding it downwards.

so what I want is to get him to shoot in the right direction on each image.
Something like:
If imagenumber=0 angle=45
If imagenumer=1 angle=0
if imagenumer=2 angle=315

Is this in anyway possible?
I also use the mirror function to get him to face the other direction, how would I get that to work with this correctly?

B
8
S
4
Posts: 120
Reputation: 1,266

Post » Fri Feb 22, 2013 12:08 am

bit difficult to know exactly what you need but...

depending on if your player is changing angle with the controls or its an animation

>player is on screen.....set bullet to player.angle degrees
player fires bullet
trigger once

or

>player compare animation frame is 1,2,3....set bullet angle accordingly

and when mirrored simply

>player is mirrored...set bullet angle to direction you want...

does that help?....
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Fri Feb 22, 2013 1:57 pm

Thanks they now shoot in the right direction, but when I shoot and then change the animation frame, all the bullets move into the new direction.
Is there any way to handle every bullet as a different object, so they wont get effected by the angle-change, when they have already been shot.

EDIT: got it fixed by making a mouse click event for every bullet direction.
Thanks!Derqs2013-02-22 15:39:50
B
8
S
4
Posts: 120
Reputation: 1,266


Return to How do I....?

Who is online

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