private void SpawnObstacle() { if (On == false) { return; } float pickedScale = _obstacleSizes.Pick(); Obstacle o = Global.Instance("Obstacle") as Obstacle; o.Position = new Vector2(Position); GetParent().AddChild(o); o.Spawn(_obstaclePickBag.Pick()); o.Scale *= new Vector2(pickedScale, pickedScale); }
private void SpawnPowerUp() { if (On) { PowerUp pu = Global.Instance("PowerUp") as PowerUp; GetParent().AddChild(pu); pu.Spawn(_powerUpPickBag.Pick()); _elapsedSinceLastPowerUp = 0; } }