private int _lastIndex; // INDEX OF LAST SPAWNED MONSTER #endregion Fields #region Constructors public LevelManager() { MoveMonster = false; // Creating Timer for Wave GetAction obj = new GetAction(ChangeWaveStatus); AccessFunction = new Action(obj); WaveTimerBreak = new TimeSpan(0, 0, 0, 30, 0); WaveServices.TimerFactory.CreateTimer("Wave_Break", Static.Const.L_Wave_Break_Timer[ Static.Const.List_Counter], AccessFunction); WaveClock = new Stopwatch(); WaveClock.Start(); _counter = 0; BaseTowerEntity = new Entity("Tower_set"); BaseMobEntity = new Entity("Monster_Set"); TowersBar = new Entity("Towers_Bar"); ScreenLayout = new Entity("Screen_layout"); Player = new Player_Classes.Player_Base(20, 500); MonsterList = new List<Mobs.Mob_Base>(); TowersList = new List<Towers_Classes.Tower_Base>(); Level = new Map_Base("Content/Maps/Test/", 5, 0, 0, 4, 4); MonsterList.Add(new Mobs.Mob_Base(Level.starting_x, Level.starting_y, Level.map,BaseMobEntity.NumChildrens)); _lastIndex= MonsterList.Count -1; BaseMobEntity.AddChild(MonsterList[0].Mob); Create_Layout(); Create_Towers_Bar(); }
public LevelManager() { MoveMonster = false; // Creating Timer for Wave GetAction obj = new GetAction(ChangeWaveStatus); AccessFunction = new Action(obj); WaveTimerBreak = new TimeSpan(0, 0, 0, 30, 0); WaveServices.TimerFactory.CreateTimer("Wave_Break", Static.Const.L_Wave_Break_Timer[ Static.Const.List_Counter], AccessFunction); WaveClock = new Stopwatch(); WaveClock.Start(); _counter = 0; BaseTowerEntity = new Entity("Tower_set"); BaseMobEntity = new Entity("Monster_Set"); TowersBar = new Entity("Towers_Bar"); ScreenLayout = new Entity("Screen_layout"); Player = new Player_Classes.Player_Base(20, 500); MonsterList = new List <Mobs.Mob_Base>(); TowersList = new List <Towers_Classes.Tower_Base>(); Level = new Map_Base("Content/Maps/Test/", 5, 0, 0, 4, 4); MonsterList.Add(new Mobs.Mob_Base(Level.starting_x, Level.starting_y, Level.map, BaseMobEntity.NumChildrens)); _lastIndex = MonsterList.Count - 1; BaseMobEntity.AddChild(MonsterList[0].Mob); Create_Layout(); Create_Towers_Bar(); }
public HUD(Player_Classes.Player_Base player) { ScreenLayout = new Entity("Screen_layout"); TowersBar = new Entity("Towers_Bar"); // Creating Icons (Lives, Money) and TextBlocks Entity lives = Static.Functions.Create_entity( "Lives", WaveServices.Platform.ScreenWidth - 32, (WaveServices.Platform.ScreenHeight / 2 - (WaveServices.Platform.ScreenHeight / 2) + 32), "Content/Layout/Lives.wpk"); Entity money = Static.Functions.Create_entity( "Money", WaveServices.Platform.ScreenWidth - (64 + 75), (WaveServices.Platform.ScreenHeight / 2) - (WaveServices.Platform.ScreenHeight / 2) + 32, "Content/Layout/Money.wpk"); MoneyCounter = Static.Functions.CreateTextBlock(player.Gold.ToString(), 75, Color.DarkGreen, TextAlignment.Right, HorizontalAlignment.Right, new Thickness(0, 0, 180, 0)); MoneyCounter = new TextBlock() { Text = player.Gold.ToString(), Width = 75, Foreground = WaveEngine.Common.Graphics.Color.DarkGreen, TextAlignment = TextAlignment.Right, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 180, 0) }; LivesCounter = Static.Functions.CreateTextBlock(player.Lives.ToString(), 75, Color.Gainsboro, TextAlignment.Right, HorizontalAlignment.Right, new Thickness(0, 0, 70, 0)); LivesCounter = new TextBlock() { Text = player.Lives.ToString(), Width = 75, Foreground = WaveEngine.Common.Graphics.Color.Gainsboro, TextAlignment = TextAlignment.Right, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(0, 0, 70, 0) }; TimerCounter = new TextBlock() { Text = "0", Width = 100, Foreground = WaveEngine.Common.Graphics.Color.BlanchedAlmond, TextAlignment = TextAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(120, 0, 0, 0) }; Tower1Sprite = Static.Functions.Create_entity( "Tower1", 0, 0, "Content/Other/TowerBar/Tower1_Sprite.wpk"); Tower1Sprite.AddComponent(new RectangleCollider()) .AddComponent(new TouchGestures()); //Tower1_Sprite.FindComponent<Transform2D>().ParentDependencyObject = null; // Tower1_Sprite.FindComponent<Transform2D>().DrawOrder = 0; }