-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
62 lines (43 loc) · 1.22 KB
/
main.lua
File metadata and controls
62 lines (43 loc) · 1.22 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
push = require 'lib/push'
WINDOW_WIDTH = 1200
WINDOW_HEIGHT = 500
VIRTUAL_WIDTH = 1200
VIRTUAL_HEIGHT = 500
local stars = love.graphics.newImage('assets/stars.png')
local starsScroll = 0
local stars_twinkle = love.graphics.newImage('assets/stars_twinkle.png')
local starsScroll = 0
local sun = love.graphics.newImage('assets/sun.png')
local sunScroll = 0
local hills = love.graphics.newImage('assets/hills.png')
local hillsScroll = 0
-- local BACKGROUND_SCROLL_SPEED = 30
-- local GROUND_SCROLL_SPEED = 60
-- local BACKGROUND_LOOPING_POINT = 707
function love.load()
love.graphics.setDefaultFilter('nearest', 'nearest')
love.window.setTitle('Spaceman')
push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, {
vsync = true,
fullscreen = false,
resizable = true
})
end
function love.resize(w, h)
push:resize(w, h)
end
function love.keypressed(key)
if key == 'escape' then
love.event.quit()
end
end
function love.draw()
push:start()
love.graphics.draw(stars, 0, 0)
love.graphics.draw(sun, 0, 0)
love.graphics.draw(hills, 0, 0)
push:finish()
end
function love.update(dt)
love.graphics.draw(stars_twinkle, 0, 0)
end