47 lines
726 B
Lua
47 lines
726 B
Lua
---@diagnostic disable: undefined-global
|
|
Mousex = 0
|
|
Mousey = 0
|
|
Cursor = nil
|
|
Bgm = nil
|
|
Click = nil
|
|
Bckg = nil
|
|
|
|
|
|
function love.load()
|
|
Cursor = love.graphics.newImage('imgs/pointer.png')
|
|
Bckg = love.graphics.newImage('imgs/bckg.png')
|
|
|
|
|
|
Bgm = love.audio.newSource('bgm/j_afrain.wav')
|
|
Bgm:setLooping(true)
|
|
Bgm:play()
|
|
|
|
Click = love.audio.newSource('snd/click.wav')
|
|
end
|
|
|
|
|
|
function love.draw()
|
|
love.graphics.draw(Bckg, 0, 0)
|
|
love.graphics.draw(Cursor, Mousex , Mousey)
|
|
end
|
|
|
|
|
|
function love.keypressed(key)
|
|
if key == "escape" then
|
|
love.event.quit()
|
|
end
|
|
end
|
|
|
|
|
|
function love.mousemoved(x, y)
|
|
Mousex = x
|
|
Mousey = y
|
|
end
|
|
|
|
|
|
function love.mousepressed(x, y, button)
|
|
if button == 1 then
|
|
Click:play()
|
|
end
|
|
end
|