0 Favourites

Different bullets directions based on image number

  • 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?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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?....

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Grid based lighting/field of view
65 15,235
elwinalice's avatar
elwinalice
Unread hot topic
62 8,274
MikeMS's avatar
MikeMS
Unread hot topic
0 Favourites
[Behavior] Grid based sight
58 36,787
Syazanie Amirin's avatar
Syazanie Amirin