i want to make a game where the player controls a tank from a top down perspective and he can move Up, Down, Left and Right. Now i want to make him shoot
and i followed the tutorial over here: http://www.yellow.indieis.me/2012/05/04 ... ng-things/
But now i have the problem that if i get closer to player.x = 0 and player.y = 0 the bullets get shoot in the oposit direction of my mouse. I think its because of this line of code
Code: Select all
local direction = math.atan2(love.mouse.getY() - player.y, love.mouse.getX() - player.x)
EDIT: I fixed it. I only had to change player.x and player.y to constants