MHD wrote:A little thing I am working on atm...
Fuuuun!

MHD wrote:A little thing I am working on atm...

MHD wrote:A little thing I am working on atm...

MHD wrote:No, it is still only beta




qubodup wrote:(it's not that exciting really)
-- Move to Cursor Love
--
-- How to use: Click on the screen and the ball will move towards the
-- mouse's position.
function load()
mousePressed = false
gotoX = 0
gotoY = 0
playerBallX = 400
playerBallY = 300
speed = 5
end
function update(dt)
if mousePressed == true then
if playerBallX ~= gotoX then
if playerBallX < gotoX then
playerBallX = playerBallX + 1
elseif playerBallX > gotoX then
playerBallX = playerBallX - 1
end
end
if playerBallY ~=gotoY then
if playerBallY < gotoY then
playerBallY = playerBallY + 1
elseif playerBallY > gotoY then
playerBallY = playerBallY - 1
end
end
else
mousePressed = false
end
end
function draw()
love.graphics.circle(1, gotoX, gotoY, 5)
love.graphics.circle(1, playerBallX, playerBallY, 20)
end
function mousereleased(x, y, button)
if button == love.mouse_left then
mousePressed = true
gotoX = x
gotoY = y
end
end
Users browsing this forum: No registered users and 0 guests