Exemple #1
0
        public Bullet Shoot(Vector2 position, int burstTime, int burstMax, bool north)
        {
            float progress = (float)burstTime / (float)burstMax;
            if (burstTime < 20)
            {
                playerIsNorth = north;
            }

            Vector2 direction;
            if (playerIsNorth)
            {
                direction = (new Vector2(1280f, (720f * (progress * 2f))) - position);
                if (progress > 0.5f)
                {
                    direction = (new Vector2(1280f, (720f - (720f * ((progress - 0.5f) * 2f)))) - position);
                }
            }
            else
            {
                direction = (new Vector2(1280f, (720f - (720f * (progress * 2f)))) - position);
                if (progress > 0.5f)
                {
                    direction = (new Vector2(1280f, (720f * ((progress - 0.5f) * 2f))) - position);
                }
            }
            direction.Normalize();
            Bullet bullet = new Bullet(spriteBatch, game, position, new Vector2(float.Parse(game.constants.getValue("BOSS", "SPRAYSPEED")), direction.Y * 20f), Constants.BOSS_BULLET_FILENAME, "Boss_bullet", EntityType.BOSS_BULLET, damage);
            return bullet;
        }
Exemple #2
0
 public override Bullet Shoot(Vector2 position, int colorValue = 0)
 {
     Bullet bullet = new Bullet(spriteBatch, game, position, new Vector2(15.0f, 0.0f), Constants.DARK_THOUGHT_BULLET_FILENAME, "DarkThought_bullet", EntityType.DARK_THOUGHT_BULLET, damage);
     return bullet;
 }
Exemple #3
0
        public Bullet ShootSpread(Vector2 position, int i)
        {
            int spread = int.Parse(game.constants.getValue("BOSS", "SHOTGUNSPREAD"));
            velocity = getVelocity(i, spread);
            float velocitySpread = (float)spread / 500f;

            switch (i)
            {
                case 0:
                    position.Y -= spread * 2;
                    break;
                case 1:
                    position.Y -= spread;
                    position.X += spread * 2;
                    velocity.X *= (1f + velocitySpread);
                    break;
                case 2:
                    position.X += spread * 3;
                    velocity.X *= (1f + velocitySpread * 2);
                    break;
                case 3:
                    position.Y += spread;
                    position.X += spread * 2;
                    velocity.X *= (1f + velocitySpread);
                    break;
                case 4:
                    position.Y += spread * 2;
                    break;
            }

            Bullet bullet = new Bullet(spriteBatch, game, position, velocity, Constants.BOSS_BULLET_FILENAME, "Boss_bullet", EntityType.BOSS_BULLET, damage);
            bullet.bigBullet = true;
            return bullet;
        }
Exemple #4
0
 public Bullet Shoot(Vector2 position, float angle)
 {
     Bullet bullet = new Bullet(spriteBatch, game, position, new Vector2(float.Parse(game.constants.getValue("BOSS", "HOMINGSPEED")), angle * 20f), Constants.BOSS_BULLET_FILENAME, "Boss_bullet", EntityType.BOSS_BULLET, damage);
     return bullet;
 }
Exemple #5
0
        public Bullet Shoot(Vector2 position, int i, int colorValue)
        {
            int spread = int.Parse(game.constants.getValue("WEAPON_POWERUP_SPREAD", "SPREAD"));
            velocity = getVelocity(i, spread);
            float velocitySpread = (float)spread / 500f;

            switch (i)
            {
                case 0:
                    position.Y -= spread * 2;
                    break;
                case 1:
                    position.Y -= spread;
                    position.X -= spread * 2;
                    velocity.X *= (1f + velocitySpread);
                    break;
                case 2:
                    position.X -= spread * 3;
                    velocity.X *= (1f + velocitySpread * 2);
                    break;
                case 3:
                    position.Y += spread;
                    position.X -= spread * 2;
                    velocity.X *= (1f + velocitySpread);
                    break;
                case 4:
                    position.Y += spread * 2;
                    break;
            }

            Bullet bullet = new Bullet(spriteBatch, game, position, velocity, Constants.PLAYER_BULLET_FILENAME, "bullet", EntityType.PLAYER_BULLET, damage, colorValue);
            bullet.bigBullet = bigBullet;
            return bullet;
        }
Exemple #6
0
        public override Bullet Shoot(Vector2 position, int colorValue = 0)
        {
            /*if (timer <= shootDelay)
            {
                return null;
            }
            else
            {
                timer = 0;
            }*/

            velocity = getVelocity();
            position = getPosition(position);
            Bullet bullet = new Bullet(spriteBatch, game, position, velocity, Constants.PLAYER_BULLET_FILENAME, "bullet", EntityType.PLAYER_BULLET, damage, colorValue);
            bullet.bigBullet = bigBullet;
            return bullet;
        }