-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
69 lines (45 loc) · 1.12 KB
/
Program.cs
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
using System;
using System.IO;
using System.Runtime.InteropServices;
using SFML.System;
namespace Nitemare3D
{
class Program
{
[DllImport("X11")]
extern public static int XInitThreads();
static void Main(string[] args)
{
XInitThreads();
Dat.Load();
GameWindow.Init();
Input.Init();
Img i = new Img("data/IMG.1");
Clock dt = new Clock();
SoundEffect.LoadSounds();
Scene.AddScene(new StartMenu());
Scene.AddScene(new MainMenu());
Scene.AddScene(new LevelSelect());
Scene.AddScene(new SoundEditor());
Scene.AddScene(new Game());
Scene.Start();
while (GameWindow.IsOpen())
{
MusicPlayer.Play(Scene.currentScene.songid);
Time.dt = dt.Restart().AsSeconds();
GameWindow.Clear();
Level.Update();
Entity.UpdateEntites();
GameWindow.DrawPcx();
GameWindow.DrawFrameBuffer();
if (!Scene.currentScene.fading)
{
Scene.currentScene.Update();
}
Input.Update();
Scene.currentScene.UpdateFading();
GameWindow.Display();
}
}
}
}