public OrkForest(Vector2 position, Map map, Vector2 patrolTarget, NewTimer timer) { this.map = map; this.timer = timer; Tag = "OrkForest"; transform = AddComponent<Transform>(); transform.Position = position; renderer = AddComponent<ViewRenderer>(); //renderer.SetImage(Managers.Content.Load<Texture2D>("Sprites/OrkForest/OrkForest_Front_0")); renderer.SetImage(Managers.Content.Load<Texture2D>("Sprites/Sprite_Sheet/RougyMon"), 32, 32); renderer.Pivot = new Vector2(renderer.ImageWidth / 2, renderer.ImageHeight / 1f); patrol = AddComponent<Patrol>(); patrol.PatrolToTarget(patrolTarget); moveSpeed = 1; collider = AddComponent<BoxCollider>(); collider.OnCollisionEnter += OnCollisionEnter; Animation = new SpriteAnimation( string.Empty, Managers.Content.Load<Texture2D>("Sprites/Sprite_Sheet/RougyMon"), Path.Combine(Managers.Content.RootDirectory, "Sprites", "Sprite_Sheet", "RougyMon.xml")); Animation.FrameDelay = 100; EventManager.OnLateUpdate += OnLateUpdate; EventManager.OnUpdate += OnUpdate; }
public UITimer(NewTimer timer) { this.timer = timer; uiGold = new UILabel(Fonts.ComicSans, new Vector2(1500, 30)); uiTimer = new UILabel(Fonts.ComicSans, new Vector2(1500, 10)); uiTimer.TextRenderer.Scale = 0.2f; uiGold.TextRenderer.Scale = 0.2f; UpdateUILabel(); EventManager.OnUpdate += OnUpdate; }
public GameplayScreen() { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); pauseAction = new InputAction( new Buttons[] { Buttons.Start, Buttons.Back }, new Keys[] { Keys.Escape }, true); timer = new NewTimer(); // Set Timer Time here timer.Time = new TimeSpan(0, 5, 0); }
public HealPotion(Vector2 position, NewTimer timer) { Tag = "HealPotion"; this.timer = timer; transform = AddComponent<Transform>(); transform.Position = position; renderer = AddComponent<Renderer>(); renderer.SetImage(Managers.Content.Load<Texture2D>("Sprites/Objects/Heal_Potion")); renderer.Pivot = new Vector2(renderer.ImageWidth / 2, renderer.ImageHeight / 2f); collider = AddComponent<BoxCollider>(); collider.OnCollisionEnter += OnCollisionEnter; EventManager.OnUpdate += OnUpdate; }