コード例 #1
0
        public static void playerShot(IPlayerShip ship)
        {
            Vector bulletPosition = new Vector(ship.getPosition(), 0, 0 - (ship.getSize() + 0.0125) / 2);
            int    bulletCount    = ship.getMultipleBullets();

            Console.Out.WriteLine("Bullet count = " + bulletCount);
            Console.Out.WriteLine("Firerate = " + ship.getFirerate());
            Console.Out.WriteLine("Power = " + ship.getPower());
            Console.Out.WriteLine("Velocity = " + ship.getVelocity().X + ", " + ship.getVelocity().Y);

            if (bulletCount >= 1)
            {
                PlayerBullet b = new PlayerBullet(bulletPosition, new Vector(0, -0.01), ship.getPower(), '1');
                b.setStrategy(ScreenView.MSStraight);
                playerBulletList.Add(b);
            }
            if (bulletCount >= 2)
            {
                PlayerBullet b = new PlayerBullet(bulletPosition, new Vector(-0.007, -0.007), ship.getPower(), '2');
                b.setStrategy(ScreenView.MSStraight);
                playerBulletList.Add(b);
            }
            if (bulletCount >= 3)
            {
                PlayerBullet b = new PlayerBullet(bulletPosition, new Vector(0.007, -0.007), ship.getPower(), '3');
                b.setStrategy(ScreenView.MSStraight);
                playerBulletList.Add(b);
            }
            if (bulletCount >= 4)
            {
                PlayerBullet b = new PlayerBullet(bulletPosition, new Vector(0.01, 0), ship.getPower(), '4');
                b.setStrategy(ScreenView.MSStraight);
                playerBulletList.Add(b);
            }
            if (bulletCount >= 5)
            {
                PlayerBullet b = new PlayerBullet(bulletPosition, new Vector(-0.01, 0), ship.getPower(), '5');
                b.setStrategy(ScreenView.MSStraight);
                playerBulletList.Add(b);
            }
        }
コード例 #2
0
 public new double getSize()
 {
     return(player.getSize());
 }