Search found 3 matches

by Heeloo
Tue Jun 24, 2014 10:25 am
Forum: Support and Development
Topic: rotate an image in the direction of the mouse
Replies: 11
Views: 9215

Re: rotate an image in the direction of the mouse

I have edited but I am getting the same error. 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 functio...
by Heeloo
Tue Jun 24, 2014 10:12 am
Forum: Support and Development
Topic: rotate an image in the direction of the mouse
Replies: 11
Views: 9215

Re: rotate an image in the direction of the mouse

I tried this

Code: Select all

function love.update(dt)
	findRotation = math.atan2(mouseY - many, mX - manx)
	man.update()
	mouseY = love.mouse.getY()
end
But I got the same error
by Heeloo
Mon Jun 23, 2014 6:58 am
Forum: Support and Development
Topic: rotate an image in the direction of the mouse
Replies: 11
Views: 9215

Re: rotate an image in the direction of the mouse

Hello I have tried to use this code but I get an error. function man.load() man = love.graphics.newImage("sprite/Char.png") manx = 0 many = 0 manxvel = 10 manyvel = 10 findRotation = math.atan2(mY - many, mX - manx) mandirection = findRotation(manx,many,love.mouse.getX(),love.mouse.getY())...