-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtitle.js
More file actions
40 lines (38 loc) · 809 Bytes
/
title.js
File metadata and controls
40 lines (38 loc) · 809 Bytes
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
gamestates["title"] = {};
gamestates["title"].cycle = 0;
gamestates["title"].cycles =
[
"TITLEPIC", "CREDIT", "CREDIT", null
];
gamestates["title"].music =
[
"D_INTROA", null, null, null
];
gamestates["title"].frame = 0;
gamestates["title"].init = function()
{
if(gamemode != "registered")
{
this.cycles.pop();
this.music.pop();
}
}
gamestates["title"].changedTo = function(reset)
{
demo.playingDemo = false;
this.frame = 0;
this.cycle++;
if(reset || this.cycle >= this.cycles.length) this.cycle = 0;
}
gamestates["title"].update = function()
{
this.frame++;
if(!this.cycles[this.cycle] || this.frame >= 175)
{
demo.loadDemo(wad.getLastLump("DEMO" + (this.cycle+1)));
}
}
gamestates["title"].draw = function()
{
if(this.cycles[this.cycle]) Patch.drawPatch(this.cycles[this.cycle],0,0);
}