-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
89 lines (69 loc) · 1.45 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
-------------------------------------------------
-- LOVE: Intro Slides
-------------------------------------------------
function love.load()
-- The amazing music.
--music = love.audio.newSource("wip1.it")
music = love.audio.newSource("thruspace.ogg")
music:setLooping(true)
music:setPitch(1)
love.audio.play(music)
love.audio.setVolume(0.1)
Slides = {}
Slides[1] = love.graphics.newImage("tmr_640.png")
Slides[2] = love.graphics.newImage("OGAlogo_640.png")
i=1 --slide#
a=255 --alpha
deltat=0 --delay time
state = 0
maxslide = 2 --highest slide number
success = love.graphics.setMode( 640, 480, false )
love.graphics.setColorMode("replace")
end
function love.draw()
love.graphics.draw(Slides[i])
love.graphics.setColor( 0,0,0,a)
love.graphics.rectangle( 'fill', 0, 0, love.graphics.getWidth(), love.graphics.getHeight() )
end
function love.keypressed(k)
--todo: skip out of intro
end
function love.update(dt)
if (state == 0) then
a = a-1.3
if a<0 then
a = 0
state = 1
end
end
if (state == 1) then
--state = 2
deltat = deltat+1
if deltat>20 then
deltat=0
state = 2
end
end
if (state == 2) then
a = a+1.3
if a>255 then
a = 255
state = 3
end
end
if (state == 3) then
if(i==maxslide) then
startGame()
end
if(i<maxslide) then
i = i+1
state = 0
end
end
end
function startGame()
local game = love.filesystem.load("game.lua")
print("Starting game...")
game()
love.load()
end