private void Travel(Room destination) { if (destination == null) { return; } MyScene.RemoveEntity(this); destination.AddEntity(this); Game.CurrentScene = destination; }
//move the player to the desistination room and change the Scene private void Travel(Scene destination) { if (destination == null) { return; } if (_sword.Parent == this) { MyScene.RemoveEntity(_sword); destination.AddEntity(_sword); } MyScene.RemoveEntity(this); destination.AddEntity(this); Game.CurrentScene = destination; }
private void TouchPlayer(float deltaTime) { List <Entity> touched; touched = MyScene.GetEntities(x, y); bool hit = false; foreach (Entity e in touched) { if (e is Player) { hit = true; break; } } if (hit) { MyScene.RemoveEntity(this); } }
private void TouchPlayer() { //Get the List of Entities in our space List <Entity> touched = MyScene.GetEntities(X, Y); //Check if any of them are Players bool hit = false; foreach (Entity e in touched) { if (e is Player) { hit = true; break; } } //If we hit a Player, remove this Enemy from the Scene if (hit) { MyScene.RemoveEntity(this); } }