Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public void Reset()
        {
            if (AllowRespawn) {
                m_currentCooldown = 0.0f;
                SpawnController.SpawnPoints.Add(this);
            }

            GameObject = null;
        }
Esempio n. 3
0
 public void removeObject(GameObject obj)
 {
     Game.Components.Remove(obj);
     GameObjects.Remove(obj);
 }
Esempio n. 4
0
 public void record(GameObject gameObject)
 {
     record(gameObject.Sprite, gameObject.Position, Color.White);
 }
Esempio n. 5
0
 public void addObject(GameObject obj)
 {
     Game.addComponent(obj);
     GameObjects.Add(obj);
 }