Пример #1
0
 public Ship(Vector pos, Game game, ParticleEngine particleEngine, Arena arena)
 {
     position = pos;
     gameref = game;
     particles = particleEngine;
     arenaref = arena;
 }
Пример #2
0
        public void Initialize(Game game)
        {
            gameref = game;
            StartLevel(1);

            particles = new ParticleEngine(gameref.Resources.GetTexture("particle"), 10000, gameref.Display.Renderer);

            System.Console.WriteLine("Initialized game state");
            player = new Ship(new Vector(525,525), gameref, particles, arena);
            player.AddComponent(new PlayerShipBody(player, 0, 0, arena));
            player.AddComponent(new SimpleGunTurret(player, 16, -4, arena));
            player.AddComponent(new SimpleGunTurret(player, -16, -4, arena));
            player.AddComponent(new SimpleGunTurret(player, 0, -16, arena));
            player.AddComponent(new SimpleGunTurret(player, 0, 16, arena));
            player.AddComponent(new SimpleGunTurret(player, 24, -4, arena));
            player.AddComponent(new SimpleGunTurret(player, -24, -4, arena));

            testShip = new Ship(new Vector(400,400), gameref, particles, arena);
            testShip.AddComponent(new PlayerShipBody(testShip, 0,0, arena));
            testShip.AddComponent(new SimpleGunTurret(testShip, 40, -3, arena));
            testShip.AddComponent(new SimpleGunTurret(testShip, -40, -4, arena));

            player.AddExhaustPort(-8, -20, 30, 3, 50);
            player.AddExhaustPort(8, -20, 30, 3, 50);
            player.AddExhaustPort(0, -24, 30, 3, 50);
        }