public void NewPowerUp(GameTime gameTime, POWERUP powerUp)
        {
            Reset();

            Active     = true;
            expireTime = gameTime.TotalGameTime + Settings.Intervals.Drop;      // lasts for min time for a drop to appear
            type       = powerUp;

            switch (type)
            {
            case POWERUP.YELLOW:
                Score = 2;
                break;

            case POWERUP.GREEN:
                Speed = 2;
                break;

            case POWERUP.BLUE:
                Projectile = 2;
                break;

            case POWERUP.RED:
                Damage = 2;
                break;
            }
        }
Exemple #2
0
 public BOBrick()
 {
     ent      = null;
     x        = y = width = height = 0;
     powerup  = POWERUP.NONE;
     isBroken = false;
 }
        public Unit_Drop_PowerUp(Game game, SpriteBatch spriteBatch, Unit_Enemy sourceEnemy, int type)
            : base(game, spriteBatch, sourceEnemy)
        {
            // type of powerup
            powerUp = (POWERUP)type;
            icon    = content.Load <Texture2D>("P_" + type);

            // center on source enemy
            position.X = (sourceEnemy.Position.X + sourceEnemy.Width / 2) - Width / 2;
            position.Y = (sourceEnemy.Position.Y + sourceEnemy.Height / 2) - Height / 2;
        }
        public Unit_Drop_PowerUp(Game game, SpriteBatch spriteBatch, Unit_Enemy sourceEnemy, int type)
            : base(game, spriteBatch, sourceEnemy)
        {
            // type of powerup
            powerUp = (POWERUP)type;
            icon = content.Load<Texture2D>("P_" + type);

            // center on source enemy
            position.X = (sourceEnemy.Position.X + sourceEnemy.Width / 2) - Width / 2;
            position.Y = (sourceEnemy.Position.Y + sourceEnemy.Height / 2) - Height / 2;
        }
Exemple #5
0
        public BOEntity(GameBustOutWindow game)
        {
            this.game = game;
            visible   = true;

            materialName = "";
            material     = null;
            width        = height = 8;
            color        = colorWhite;
            powerup      = POWERUP.NONE;

            position.Zero();
            velocity.Zero();

            removed = false;
            fadeOut = false;
        }
Exemple #6
0
        public BOBrick(BOEntity ent, float x, float y, float width, float height)
        {
            this.ent    = ent;
            this.x      = x;
            this.y      = y;
            this.width  = width;
            this.height = height;
            powerup     = POWERUP.NONE;

            isBroken = false;

            ent.position.x = x;
            ent.position.y = y;
            ent.SetSize(width, height);
            ent.SetMaterial("game/bustout/brick");

            ent.game.entities.Add(ent);
        }
Exemple #7
0
    //public AudioSource maleScreams;



    void Start()
    {
        GameObject Camera = GameObject.FindGameObjectWithTag("Camera");

        gamemanager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
        POWERUP powerup = new POWERUP(PlayerPrefs.GetInt("Char" + (InternalPlayerIndex + 1) + "Power"));
        int     charint = PlayerPrefs.GetInt("Character" + (InternalPlayerIndex + 1));

        if (charint < 0)
        {
            charint = 0;
        }
        else if (charint > 5)
        {
            charint = 5;
        }
        if (!DebugMode)
        {
            Character = (character)(charint);
        }
        CharacterStats stats = new CharacterStats(Character);

        Strength    += (powerup.Strength + stats.Strength);
        SpeedLimiter = (stats.SpeedLimiter + powerup.Speed);
        Gender       = stats.Gender;
        // SpeedLimiter -= powerup.Speed;
        RotationSnapRange += (powerup.Stability + stats.RotationSnapRange);
        SolidCharacters[(int)Character].SetActive(true);
        GetComponent <Rigidbody>().mass         = Mass;
        GetComponent <Rigidbody>().centerOfMass = CenterofGravity;
        this.gameObject.transform.GetChild(1).GetComponent <Joust>().Strength = Strength;//The joust

        if (SpeedLimiter < 1)
        {
            SpeedLimiter = 1;
        }
        if (RotationSnapRange < 1)
        {
            RotationSnapRange = 1;
        }

        InitController();
    }
Exemple #8
0
        private static string PowerUpToString(POWERUP power)
        {
            switch (power)
            {
            case POWERUP.NONE:
                return(string.Empty);

            case POWERUP.LINE:
                return("-");

            case POWERUP.CROSS:
                return("+");

            case POWERUP.COLOR:
                return("#");

            default:
                throw new System.NotImplementedException(power + " not yet added");
            }
        }
Exemple #9
0
    void RandomState()
    {
        int i = Random.Range(0, 4);

        switch (i)
        {
            case 0:
            state = POWERUP.ESCUDO;
            break;

            case 1:
            state = POWERUP.INVISIVEL;
            break;

            case 2:
            state = POWERUP.LENTO;
            break;

            case 3:
            state = POWERUP.TURBO;
            break;
        }
    }