-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (28 loc) · 900 Bytes
/
Program.cs
File metadata and controls
33 lines (28 loc) · 900 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
using Raylib_cs;
using static Code;
public class Program
{
public static List<State> states = new List<State>();
public static void Main()
{
Raylib.SetConfigFlags(ConfigFlags.VSyncHint | ConfigFlags.ResizableWindow);
Raylib.InitWindow(500, 500, "Snake");
Raylib.SetWindowSize((int)(Raylib.GetMonitorWidth(0) * 0.75f), (int)(Raylib.GetMonitorHeight(0) * 0.75f));
CenterWindow();
Image icon = Raylib.LoadImage("Assets/SnakeIcon.png");
Raylib.SetWindowIcon(icon);
states.Add(new Game());
while (Raylib.WindowShouldClose() == false && states.Count > 0)
{
states.Last().Update();
states.Last().Draw();
}
for (int i = 0; i < states.Count(); i++)
{
states[i].Unload();
states.RemoveAt(i);
}
Raylib.UnloadImage(icon);
Raylib.CloseWindow();
}
}