public new void Enter() { Input.Pressed += OnBackPressed; base.Enter(); ScheduleManager.ScheduleInLoop(3, () => { if (server.world != null) { SurpriseBoxDrop dummyBox = new SurpriseBoxDrop(0, 0); dummyBox.SpawnInAnEmptyPosition(server.world.maze); Point spawnPosition = dummyBox.GetAABB().Center; server.AddDrop((int)DropTypes.SurpriseBoxDrop, spawnPosition.X, spawnPosition.Y); } }); }
public void OnDropAdded(object source, GameplayDropEventArgs args) { Drop drop = null; switch (args.Type) { case (int)DropTypes.SurpriseBoxDrop: drop = new SurpriseBoxDrop(args.X, args.Y); break; case (int)DropTypes.BananaDrop: drop = new BananaDrop(args.X, args.Y); break; default: throw new System.ComponentModel.InvalidEnumArgumentException(); } Drops.Add(args.Id, drop); }