Issue with setting bullet angle of motion

0 favourites
  • 3 posts
From the Asset Store
Complete the collection by purchasing Motion Universe Pt. 2
  • Hi,

    In order to learn the ways of Construct I've been working on remaking the game I worked on at the Global Game Jam back in January. The basic idea behind the game is that you're competing medical dudes playing defib golf with heart attack prone patients.

    Here's the capx:

    The defib mechanic is at event #30. Controls are WASD to move and space (hold) to defib. Note that I'm using the full version of Construct.

    Learning Construct has been great so far but recently I've run into an issue with setting the bullet angle of motion on the NPCs; roughly half of the time player 1 shocks an NPC (sending them flying) the NPC will go flying off in the wrong direction. It looks like the bullet angle of motion is being set 180 degrees off. However, I've confirmed that the angle is being set correctly so the issue must be in something else that I can't figure out. Also, this issue only happens with player 1. Player 2's (who's hard-coded in to be controlled with a controller right now) shocks always send people off at the right angle.

    Any help would be greatly appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I couldn't reproduce your problem, but I did notice you set the bullet direction according to player.x,player.y, which is it's origin. The origin of the player however is in the middle of the player sprite and not at his feet where the defib-radius is.. So maybe if you calculate the angle from the imagepoint at the center of the defib-radius you'd get better results?

    I don't know if this is the right answer to your problem, but it would seem more logical to me than using the middle of the player sprite..

  • Thanks for the quick reply. You're right that it makes a lot more sense to have the angle calculated from the base of the sprite. After changing this however I'm still having the same issue.

    I probably wasn't clear enough about the issue; if you stand (for example) above an NPC and do a defib about half the time they fly up instead of down as you would expect.


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)