0
I’m trying to use Löve 2D, I started creating a game where eyes follow the mouse. But always when I try to play the show, it stops responding. And not only in my code, the executable in the LOVE folder runs for a few frames and stops responding as well. The code I made so far:
function love.draw()
--@ Eye position @--
local eyeX = 250
local eyeY = 250
--@ Distance X and Y between eye - mouse @--
local distanceX = love.mouse.getX() - eyeX
local distanceY = love.mouse.getY() - eyeY
--@ Distance (straight line) between eye - mouse @--
local distance = math.sqrt(distanceX^2 + distanceY^2)
--@ Draw eye @--
love.graphics.setColor(1, 1, 1)
love.graphics.circle("fill", eyeX, eyeY, 75)
--@ Draw pupil @--
love.graphics.setColor(0, .5, 1)
love.graphics.circle("fill", 250, 250, 25)
--@ Print values @--
love.graphics.setColor(1, 1, 1)
love.graphics.print(table.concat({
'Distance X: ' ..distanceX,
'Distance Y: ' ..distanceY
}, '\n'))
end
The result: He draws an eye and prints some information, but soon stops responding.
As I said, the problem isn’t just my code:
Ever tried to reinstall? Do you have access to any log? If you have, post it in the question
– Wallace Maxters
Yeah, I don’t have. .
– TGira
Well I did some more tests and found that the problem is specifically in the drawing functions, like love.graphics.Circle("Fill", eyeX, eyeY, 75)
– TGira
now because I don’t know
– TGira