-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
37 lines (34 loc) · 911 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
love.graphics.setDefaultFilter('nearest', 'nearest')
bgColor = {red=58, green=95, blue=159,alpha=1}
scene = nil;
gs = 16
scale = 4
absolutePath = "D:/Game Projects/Love2d Projects/MEAN LEFT HOOK/"
require("gamescene")
function love.load()
love.graphics.setLineStyle( 'rough' )
love.window.setMode(15*64, 10*64)
love.graphics.setBackgroundColor(bgColor.red, bgColor.green, bgColor.blue, bgColor.alpha)
changeScene(GameScene.new())
end
function love.update(dt)
scene:update(dt)
end
function love.draw()
love.graphics.scale(scale, scale)
scene:draw()
end
function love.keypressed(k)
scene:keyPressed(k)
if (k == "r") then love.event.quit("restart") end
end
function love.mousepressed(x, y, button, isTouch)
scene:mousepressed(x, y, button)
end
function love.mousereleased(x, y, button, isTouch)
scene:mousereleased(x, y, button)
end
function changeScene(newScene)
scene = newScene
scene:load()
end