コード例 #1
0
        private void CreatePowerUpContainer(List <string> aVariableString)
        {
            float       positionX   = float.Parse(aVariableString[0]);
            float       positionY   = float.Parse(aVariableString[1]);
            int         powerUp     = int.Parse(aVariableString[2]);
            PowerUpType powerUpType = PowerUpType.None;

            switch (powerUp)
            {
            case 0:
                powerUpType = PowerUpType.Violet;
                break;

            case 1:
                powerUpType = PowerUpType.Blue;
                break;

            case 2:
                powerUpType = PowerUpType.Orange;
                break;

            case 3:
                powerUpType = PowerUpType.Green;
                break;

            case 4:
                powerUpType = PowerUpType.None;
                break;
            }

            PowerUpContainer powerUpContainer = new PowerUpContainer(new Vector2(positionX, positionY), powerUpType);

            powerUpContainer.SpawnPowerUpBall += SpawnPowerUpBall;
            myPlatforms.Add(powerUpContainer);
        }
コード例 #2
0
 public PowerUpBall(PowerUpType aPowerUpBallType, PowerUpContainer aContainer, Player aPlayer)
     : base("PowerUpBalls", new Vector2(aContainer.Position.X, aContainer.Position.Y - 25), 25, 5, 4, 0, 1, 50)
 {
     InitializeMemberVariables(aPowerUpBallType);
     CalculateSpeed(aPlayer);
 }