Issues with shooting

thompsonjm22thompsonjm22 Member Posts: 15
edited February 2012 in Working with GS (Mac)
For my platformer I'm running into issues when attempting to use a "gun". Right now I have the code set up for the player to collide with the gun placed in the level. Once they collide with the gun I set the gun attribute to true. If the gun attribute is true and the player clicks the mouse he or she then shoots. When I am running right the bullets work just fine as I shoot the gun, however; when I shoot left, the bullets slowly gravitate towards the ground and fly out of the bottom of the scene, any ideas to what may be causing this?

Comments

  • poopdecksweeperpoopdecksweeper Member Posts: 180
    What rules are you placing on the movement of your shot? Accel? change velocity? move?

    I would suggest this: have the shot actor have a change velocity rule with the direction: VectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y ) and the speed set to 500, and relative to scene.

    if it doesn't work, it is because you have gravity on.
  • FallacyStudiosFallacyStudios Member Posts: 970
    Ya it does sound like that is a gravity issue. I would check to make sure you don't have a global gravity. Unless you want literally everything except the bullet effected by gravity. One way to reverse the gravity on one object would be to use an accelerate straight up at the same number gravity is set to.
Sign In or Register to comment.