function love.draw() local eyeX = 200 local eyeY = 200 local distanceX = love.mouse.getX() - eyeX local distanceY = love.mouse.getY() - eyeY local distance = math.min(math.sqrt(distanceX^2 + distanceY^2), 30) local angle = math.atan2(distanceY, distanceX) local pupilX = eyeX + (math.cos(angle) * distance) local pupilY = eyeY + (math.sin(angle) * distance) love.graphics.setColor(1, 1, 1) love.graphics.circle('fill', eyeX, eyeY, 50) love.graphics.setColor(0, 0, .4) love.graphics.circle('fill', pupilX, pupilY, 15) love.graphics.setColor(1, 1, 1) love.graphics.print(table.concat({ 'distance x: '..distanceX, 'distance y: '..distanceY, 'distance: '..distance, 'angle: '..angle, 'cos(angle): '..math.cos(angle), 'sin(angle): '..math.sin(angle), }, '\n')) end