示例#1
0
    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);
    }
示例#2
0
 private void SpawnPowerUp()
 {
     if (On)
     {
         PowerUp pu = Global.Instance("PowerUp") as PowerUp;
         GetParent().AddChild(pu);
         pu.Spawn(_powerUpPickBag.Pick());
         _elapsedSinceLastPowerUp = 0;
     }
 }