/// <summary> /// Load graphics content for the screen. /// </summary> public override void LoadContent() { spriteBatch = new SpriteBatch(m_core.GraphicsDevice); m_player = new Player(); m_floor = new Floor(); m_enemy = new Enemy(); // m_building = new Building(); GameCore.Camera.Player = m_player; font = m_core.Content.Load<SpriteFont>("gamefont"); //m_player.Model = m_core.Content.Load<Model>("player/soldier2"); m_player.Model = m_core.Content.Load<Model>("player/vojak_anim"); m_floor.Model = m_core.Content.Load<Model>("other/model2"); //m_enemy.Model = m_core.Content.Load<Model>("player/zombie"); // m_building.Model = m_core.Content.Load<Model>("other/blok_1"); // Look up our custom skinning information. SkinningData skinningDataPlayer = m_player.Model.Tag as SkinningData; if (skinningDataPlayer == null) throw new InvalidOperationException ("This model does not contain a SkinningData tag."); m_player.Anim = new AnimationPlayer(skinningDataPlayer); AnimationClip clip = skinningDataPlayer.AnimationClips["Action"]; m_player.Anim.StartClip(clip); // Load the model. m_enemy.Model = m_core.Content.Load<Model>("player/zombie2_bones"); // Look up our custom skinning information. SkinningData skinningData = m_enemy.Model.Tag as SkinningData; if (skinningData == null) throw new InvalidOperationException ("This model does not contain a SkinningData tag."); // Create an animation player, and start decoding an animation clip. //animationPlayer = new AnimationPlayer(skinningData); m_enemy.Anim = new AnimationPlayer(skinningData); AnimationClip clip2 = skinningData.AnimationClips["Animace"]; m_enemy.Anim.StartClip(clip2); }
/// <summary> /// Load graphics content for the screen. /// </summary> public override void LoadContent() { spriteBatch = new SpriteBatch(m_core.GraphicsDevice); m_player = new Player(); m_floor = new Floor(); m_enemy = new Enemy(); m_car = new Car(); m_tree = new Tree(); m_building1 = new Building(); m_building2 = new Building(); m_building3 = new Building(); m_building4 = new Building(); m_building5 = new Building(); m_building6 = new Building(); m_building7 = new Building(); m_building8 = new Building(); m_building9 = new Building(); m_building10 = new Building(); m_building11 = new Building(); m_building12 = new Building(); coll_manager = new CollisionManager(); m_block = new RoadBlock(); GameCore.Camera.Player = m_player; font = m_core.Content.Load<SpriteFont>("gamefont"); m_player.Model = m_core.Content.Load<Model>("player/soldier2"); m_floor.Model = m_core.Content.Load<Model>("other/model2"); m_enemy.Model = m_core.Content.Load<Model>("player/zombie"); m_car.Model = m_core.Content.Load<Model>("other/skoda"); m_tree.Model = m_core.Content.Load<Model>("other/strom"); m_block.Model = m_core.Content.Load<Model>("other/zataras"); m_building1.Model = m_core.Content.Load<Model>("other/budova_skola/blok_a"); m_building2.Model = m_core.Content.Load<Model>("other/budova_skola/blok_a"); m_building3.Model = m_core.Content.Load<Model>("other/budova_skola/blok_a"); m_building4.Model = m_core.Content.Load<Model>("other/budova_skola/blok_a"); m_building5.Model = m_core.Content.Load<Model>("other/budova_skola/blok_b"); m_building6.Model = m_core.Content.Load<Model>("other/budova_skola/blok_c"); m_building7.Model = m_core.Content.Load<Model>("other/budova_skola/blok_c"); m_building8.Model = m_core.Content.Load<Model>("other/budova_skola/blok_c"); m_building9.Model = m_core.Content.Load<Model>("other/budova_skola/blok_vchod_a"); m_building10.Model = m_core.Content.Load<Model>("other/budova_skola/blok_vchod_b"); m_building11.Model = m_core.Content.Load<Model>("other/budova_skola/blok_vchod_a"); m_building12.Model = m_core.Content.Load<Model>("other/budova_skola/blok_podstava"); m_car.Position = new Vector3(0, -6, -20); m_car.setBoundingBox(); coll_manager.AddEntity(m_car); m_block.Position = new Vector3(20, -6, -20); m_block.setBoundingBox(); coll_manager.AddEntity(m_block); m_tree.Position = new Vector3(20, 5, 0); m_tree.setBoundingBox(); coll_manager.AddEntity(m_tree); m_building1.Position = new Vector3(130, 4, 90); m_building2.Position = new Vector3(-30, 4, 90); m_building3.Position = new Vector3(-190, 4, 90); m_building4.Position = new Vector3(290, 4, 90); m_building5.Position = new Vector3(-200, 4, 100); m_building6.Position = new Vector3(-130, 4, 140); m_building7.Position = new Vector3(30, 4, 140); m_building8.Position = new Vector3(190, 4, 140); m_building9.Position = new Vector3(-130, 4, 80); m_building10.Position = new Vector3(30, 4, 80); m_building11.Position = new Vector3(190, 4, 80); m_building12.Position = new Vector3(250, -5, 30); m_building1.setBoundingBox(); m_building2.setBoundingBox(); m_building3.setBoundingBox(); m_building4.setBoundingBox(); m_building5.setBoundingBox(); m_building6.setBoundingBox(); m_building7.setBoundingBox(); m_building8.setBoundingBox(); m_building9.setBoundingBox(); m_building10.setBoundingBox(); m_building11.setBoundingBox(); coll_manager.AddEntity(m_building1); coll_manager.AddEntity(m_building2); coll_manager.AddEntity(m_building3); coll_manager.AddEntity(m_building4); coll_manager.AddEntity(m_building5); coll_manager.AddEntity(m_building6); coll_manager.AddEntity(m_building7); coll_manager.AddEntity(m_building8); coll_manager.AddEntity(m_building9); coll_manager.AddEntity(m_building10); m_player.Manager = coll_manager; }
/// <summary> /// Unload content for the screen. /// </summary> public override void UnloadContent() { font = null; m_player = null; GameCore.Camera.Player = null; spriteBatch = null; m_floor = null; m_enemy = null; // m_building = null; }