0 Favourites

8 Directional Shooting

  • I seem to be having a problem with 8 Directional Shooting,

    I have a character that has 8 sets of animations for 8 Directions.

    And i have a bullet that needs to shoot in the direction the player is facing.

    I've tried rotating the bullet At spawn time to the players angle, but thats not working.

    If i set my player to Rotate towards the mouse i can then shoot in 8 directions, but thats not the controls i want.

    I know it will be something simple, but my head now hurts....

    CapX Here

  • Hmm, the way you have done it the only option I see is to have a bunch of events under the shooting bit which basically go like "If animation is bottom left, set bullet angle to 45".

    But the whole setup seems wrong, you'd want to add animation angles and have the system select them, instead of arrow key combinations. Then you could just read the angle from the sprite.

  • I see but it seems very long winded to shoot in a direction your facing, i thought it would automaticaly shoot in the direction that the sprite it's being spawned from.

    And it's the only way i could in my limited knowledge of C2 get all my animations to run.

    Maybe instead of having to rotate ALL sprites in every game there should be an arrow that could be added in the sprite editor to just select which way is which. So that the Players and Bullets would just go the way they are facing.

    Also with the rotating thing it sometimes creates sprites to be out of alignment when animating.

    I do seem to spend alot of time in my games rotating sprites, in the Editor and then on the layout and then again in the events.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Ended up setting a variable at the tip of my gun then.

    angle(PMerc.X, PMerc.Y, PMerc.ImagePointX("aim"), PMerc.ImagePointY("aim"))

    then

    angle PMerc.DirectionAngle

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
Dangerous Dave style shooting?
48 1,876
newt's avatar
newt
Topic
18 2,102
minigame's avatar
minigame
Unread hot topic
29 1,676
Lordshiva1948's avatar
Lordshiva1948