internal GameObject Spawn() { SpawnController.SpawnPoints.Remove(this); // Update SpawnPoint in case it gets triggered again. HasBeenOffscreen = false; switch (GameObjectType) { case "spawn": GameObject = new PlayerCharacter(SpawnController.GameScreen, this); break; case "goblin": GameObject = new Goblin(SpawnController.GameScreen, this); break; case "light": GameObject = new LightSource(SpawnController.GameScreen, this.Position); break; default: throw new InvalidOperationException("Invalid entity type."); } SpawnController.GameScreen.addObject(GameObject); return GameObject; }
public void Reset() { if (AllowRespawn) { m_currentCooldown = 0.0f; SpawnController.SpawnPoints.Add(this); } GameObject = null; }
public void removeObject(GameObject obj) { Game.Components.Remove(obj); GameObjects.Remove(obj); }
public void record(GameObject gameObject) { record(gameObject.Sprite, gameObject.Position, Color.White); }
public void addObject(GameObject obj) { Game.addComponent(obj); GameObjects.Add(obj); }