-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainImmature.js
More file actions
23 lines (18 loc) · 793 Bytes
/
mainImmature.js
File metadata and controls
23 lines (18 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { Engine, LevelHandler } from "./Root/Engine.js";
import { Screen } from "./Window/Screen.js";
import { Input } from "./Input/Input.js";
import { TechDemoLevel } from "./Demo/TechDemoLevel.js";
try {
// 1. Inicia o Singleton do Teclado
new Input();
// 2. Cria a Tela (Vai procurar uma <canvas id="gameCanvas"> no seu Main.html)
// Se o seu Screen.js criar automaticamente caso não exista, melhor ainda!
const screen = new Screen("gameCanvas", 800, 600);
// 3. Adiciona nossa Tech Demo na lista de Fases e define como a Fase 0
LevelHandler.addLevel(new TechDemoLevel(screen));
// 4. Dá o Play na Engine!
Engine.OnStart();
console.log("GameForgeJS Iniciada com sucesso!");
} catch(exception) {
console.error(`Exception: ${exception}`);
}