-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
58 lines (47 loc) · 1.17 KB
/
main.lua
File metadata and controls
58 lines (47 loc) · 1.17 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
-- Main de CloudRunner
require 'cloud_strife'
require 'cloudinho_spawner'
require 'balao_spawner'
require 'aviao_spawner'
require 'meteoro_spawner'
function love.load()
bg = love.graphics.newImage("paris_2.jpg")
music = love.audio.newSource("processing_defconzero.mp3")
love.audio.play(music)
strife = CloudStrife(100,100)
cloudinho_spawner = CloudinhoSpawner()
balao_spawner = BalaoSpawner()
aviao_spawner = AviaoSpawner()
meteoro_spawner = MeteoroSpawner()
bgx = 0
bgspd = 500
time1 = love.timer.getTime()
end
function love.update(dt)
strife:update(dt)
cloudinho_spawner:update(dt, strife)
aviao_spawner:update(dt)
balao_spawner:update(dt)
meteoro_spawner:update(dt)
bgx = bgx + bgspd * dt
if(bgx > 3205) then
bgx = 0
end
time2 = love.timer.getTime()
if (time2 - time1 > 5) then
--strife:raiseLife(20)
time1 = time2
end
end
function love.draw()
love.graphics.draw(bg, -bgx, 0, 0, 1, 1)
strife:draw()
cloudinho_spawner:draw()
aviao_spawner:draw()
balao_spawner:draw()
meteoro_spawner:draw()
end
function love.mousepressed(x, y, button)
end
function love.keypressed(key, unicode)
end