-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.cs
99 lines (86 loc) · 3.11 KB
/
Game.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using Aiv.Engine;
using OpenTK;
using Aiv.Vorbis;
using GlobalGameJam2016.EnemyList;
using GlobalGameJam2016.Enviroment;
using GlobalGameJam2016.PlayerList;
namespace GlobalGameJam2016
{
static class Game
{
private static Engine engine;
public static PlayerEarth player3;
public static PlayerAir player;
public static PlayerFire player2;
public static PlayerWater player4;
public static EnemyEarthMedium enemy;
public static EnviromentEarth enviromentEarth;
public static StartEnvironment startEnvironment;
//public static EnemyAirEasy enemyAir;
public static void Init()
{
engine = new Engine("Game", 1280, 720, 60, false);
Asset.BasePath = "../../assets/";
Utils.LoadAssets(engine, "playerDefault", "playerDefault.png", 1, 1);
/*player = new PlayerEarth(60, 80, true, "playerDefault");*/
Utils.LoadAssets(engine, "startHub", "base.png", 1, 1);
startEnvironment = new StartEnvironment(1280, 720);
Utils.LoadAssets(engine, "hero", "images.png", 4, 4);
player = new PlayerAir(60, 80, true, "hero");
player.X = 600;
player.Y = 130;
player2 = new PlayerFire(60, 80, true, "hero");
player2.X = 800;
player2.Y = 330;
player3 = new PlayerEarth(60, 80, true, "hero");
player3.X = 600;
player3.Y = 530;
player4 = new PlayerWater(60, 80, true, "hero");
player4.X = 400;
player4.Y = 330;
/*Utils.LoadAssets(engine, "background", "background.png", 1, 1);
enviromentEarth = new EnviromentEarth(1280, 720);
EnemyEarth[] enemyEarths = new EnemyEarth[Utils.Randomize(3, 7)];
for (int i = 0; i < enemyEarths.Length; i++)
{
int rX, rY;
do
{
rX = Utils.Randomize(1, 15);
rY = Utils.Randomize(1, 32);
} while (enviromentEarth.tiles[Utils.GetPos(rX, rY, 14)].tileType != TileType.None);
if (Utils.Randomize(0, 100) < 25)
enemyEarths[i] = new EnemyEarthMedium(engine, rX * 80, rY * 80);
else
enemyEarths[i] = new EnemyEarthMedium(engine, rX * 80, rY * 80);
}
Utils.LoadAssets(engine, "background", "background.png", 1, 1);
enviromentEarth = new EnviromentEarth(1280, 720);
// Utils.LoadAssets(engine, "undestrWall", "undestrWall.png", 1, 1);
// Utils.LoadAssets(engine, "destrWall", "destrWall.png", 1, 1);*/
#if DEBUG
engine.debugCollisions = true;
#endif
engine.SpawnObject("startHub", startEnvironment);
engine.SpawnObject("player", player);
engine.SpawnObject("player2", player2);
engine.SpawnObject("player3", player3);
engine.SpawnObject("player4", player4);
//engine.SpawnObject("enemy", enemy);
/*for (int i = 0; i < enviromentEarth.tiles.Length; i++)
{
engine.SpawnObject("wall" + i, enviromentEarth.tiles[i]);
}
for (int i = 0; i < enemyEarths.Length; i++)
{
engine.SpawnObject("enemy" + Utils.Randomize(0, Int32.MaxValue), enemyEarths[i]);
}
//engine.SpawnObject("enemyAir", enemyAir);*/
}
public static void Run()
{
engine.Run();
}
}
}