8 Directional Shooting

0 favourites
  • 4 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • 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.

  • Try Construct 3

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

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

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