public void OnActivated(params object[] args) { Manager.GameSettings.MusicVolume = 0.05f; SoundManager.StopAllLoops(); SoundManager.PlaySound(DataHandler.Sounds[SoundType.Loop], SoundCategory.Music, true); gameover = won = false; // Specifications of the world short cameradistance = 40; // Create world world.FloorWidth = cellspr; world.FloorHeight = cellspr; world.Clear(); world.ActiveCam = new OrbitCamera(cameradistance); world.CreateTerrain(); #region TestCode //world.Add(new StarBox(new Vector3(50, 0, 100))); //world.Add(new FirstAidBag(new Vector3(50, 0, 100))); //world.Add(new LandMine(new Vector3(50, 0, 100))); //world.Add(new Dagger(player.Position, player.Rotation)); //world.Add(new BrickWall(new Vector3(-Wall.WallLowAnchor.X, 0, -Wall.WallLowAnchor.Z), 0)); //world.Add(new BrickWall(new Vector3(-Wall.WallLowAnchor.Z, 0, -Wall.WallLowAnchor.X), 1)); #endregion int d = 6; currentmap = new Map(cellspr, cellspr, new Rectangle(cellspr / 2 - d / 2, cellspr / 2 - d / 2, d, d)); currentmap.BuildMaze(); player = new Player(new Vector3((cellspr / 2 + d / 4) * Map.Celld, 0, cellspr / 2 * Map.Celld), Vector3.Zero, 0.02f); player.Rotation = new Vector3(0, -MathHelper.PiOver2, 0); esc = new EscapeDrone(new Vector3((cellspr / 2 - d / 4) * Map.Celld, 0, cellspr / 2 * Map.Celld)); world.Add(player); world.Add(esc); //player.Position += new Vector3(-300, 0, 0); //player.Position = esc.Position; /* * Model testmodel = Manager.Game.Content.Load<Model>("Models\\Fence\\model"); * Object3D obj = new Object3D(testmodel, Vector3.Zero, Vector3.Zero, Vector3.Zero, Vector3.Zero, 2); * obj.Position = player.Position + new Vector3(50,0,50); * world.Add(obj); */ new NPCCoordinator(currentmap); var coord = NPCCoordinator.GetInstance(); PopulateMap(); BuildGUI(); #if !DEBUG Manager.Game.IsMouseVisible = false; world.ActiveCam.LockMouse = true; #endif }
public void OnActivated(params object[] args) { Manager.GameSettings.MusicVolume = 0.05f; SoundManager.StopAllLoops(); SoundManager.PlaySound(DataHandler.Sounds[SoundType.Loop], SoundCategory.Music, true); gameover = won = false; // Specifications of the world short cameradistance = 40; // Create world world.FloorWidth = cellspr; world.FloorHeight = cellspr; world.Clear(); world.ActiveCam = new OrbitCamera(cameradistance); world.CreateTerrain(); #region TestCode //world.Add(new StarBox(new Vector3(50, 0, 100))); //world.Add(new FirstAidBag(new Vector3(50, 0, 100))); //world.Add(new LandMine(new Vector3(50, 0, 100))); //world.Add(new Dagger(player.Position, player.Rotation)); //world.Add(new BrickWall(new Vector3(-Wall.WallLowAnchor.X, 0, -Wall.WallLowAnchor.Z), 0)); //world.Add(new BrickWall(new Vector3(-Wall.WallLowAnchor.Z, 0, -Wall.WallLowAnchor.X), 1)); #endregion int d = 6; currentmap = new Map(cellspr, cellspr, new Rectangle(cellspr / 2 - d / 2, cellspr / 2 - d / 2, d, d)); currentmap.BuildMaze(); player = new Player(new Vector3((cellspr / 2 + d / 4) * Map.Celld, 0, cellspr / 2 * Map.Celld), Vector3.Zero, 0.02f); player.Rotation = new Vector3(0, -MathHelper.PiOver2, 0); esc = new EscapeDrone(new Vector3((cellspr / 2 - d / 4) * Map.Celld, 0, cellspr / 2 * Map.Celld)); world.Add(player); world.Add(esc); //player.Position += new Vector3(-300, 0, 0); //player.Position = esc.Position; /* Model testmodel = Manager.Game.Content.Load<Model>("Models\\Fence\\model"); Object3D obj = new Object3D(testmodel, Vector3.Zero, Vector3.Zero, Vector3.Zero, Vector3.Zero, 2); obj.Position = player.Position + new Vector3(50,0,50); world.Add(obj); */ new NPCCoordinator(currentmap); var coord = NPCCoordinator.GetInstance(); PopulateMap(); BuildGUI(); #if !DEBUG Manager.Game.IsMouseVisible = false; world.ActiveCam.LockMouse = true; #endif }