-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
executable file
·66 lines (48 loc) · 1.28 KB
/
main.js
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
//Undertale PS2
const screen = Screen.getMode()
import { dynamicDrawText, drawText, resetText } from "modules/text_utils.js"
import { introScene, intro_gc } from "intro.js"
import { GAME_INTRO, GAME_PRE_MENU, GAME_MENU, GAME_INGAME } from "modules/global_constants.js"
import { globalVariables } from "modules/savefile.js"
import * as music from "modules/music.js"
let timer = Timer.new()
let gameState = GAME_INTRO
let pad = Pads.get(0)
globalVariables.loadFile()
music.play(music.mus_story)
while(gameState == GAME_INTRO)
{
if (introScene(pad, timer) == GAME_PRE_MENU) {
gameState = GAME_PRE_MENU
}
}
intro_gc()
import * as sfx from "modules/sfx.js"
import { preMenuScene, menuScene, menu_gc } from "menu.js"
Timer.reset(timer)
music.pause(music.mus_story)
Sound.setVolume(100)
Sound.play(sfx.intro_noise, 0)
while (gameState == GAME_PRE_MENU)
{
if (preMenuScene(pad, timer) == GAME_MENU) {
gameState = GAME_MENU
}
}
music.free(music.mus_story)
music.play(music.mus_menu0, true)
while (gameState == GAME_MENU)
{
if (menuScene(pad) == GAME_INGAME) {
gameState = GAME_INGAME
}
}
music.pause(music.mus_menu0)
//music.free(music.mus_menu0)
music.load(music.mus_ruins)
menu_gc()
import { ingameScene } from "ingame.js"
while (gameState == GAME_INGAME)
{
ingameScene(pad, timer)
}