Re: rotate an image in the direction of the mouse
Posted: Tue Jun 24, 2014 10:25 am
I have edited but I am getting the same error.
the error I get is
main.lua:12: attempt to perform arithmetic on global 'mouse Y' (a nil value)
Code: Select all
local zombo = require "zombo"
local man = require "man"
function love.load()
man.load()
zombo.load()
end
function love.update(dt)
findRotation = math.atan2(mouseY - many, mX - manx)
man.update()
mouseY = love.mouse.getY()
end
function love.keypressed(key)
if key == "escape" then
love.event.quit()
end
end
function love.draw()
man.draw()
zombo.draw()
end
main.lua:12: attempt to perform arithmetic on global 'mouse Y' (a nil value)