Beispiel #1
0
        protected override void OnLoad(EventArgs e)
        {
            this.renderer = new GameRenderer();

            this.game = new GameState();

            InputManager.Initialize(null);
        }
Beispiel #2
0
        public void Draw(GameState game)
        {
            this.surfaces.ModelviewMatrix.Matrix = Matrix4.LookAt(
                new Vector3(0, 0, 50), new Vector3(0, 0, 0), new Vector3(0, 1, 0)
                );

            game.Render();
        }
Beispiel #3
0
 public Particle(GameState game, Color color, Vector2 position, Vector2 velocity, float lifeTime)
     : base(game)
 {
     this.color = color;
     this.position = position;
     this.velocity = velocity;
     this.deathTime = game.TimeF + lifeTime;
 }
Beispiel #4
0
 public Projectile(GameState game, Ship owner, Vector2 position,
     Vector2 baseVelocity, Direction2 direction, float speed, float lifeTime)
     : base(game)
 {
     this.owner = owner;
     this.position = position;
     this.velocity = baseVelocity + direction.Vector * speed;
     this.deathTime = game.TimeF + lifeTime;
 }
Beispiel #5
0
 public static void Create(GameState game, int count, Color color, Vector2 position,
     Direction2 direction, float directionVariance, float speed, float lifeTime)
 {
     for (int i = 0; i < count; i++)
     {
         new Particle(game, color, position,
             direction + (StaticRandom.Float(-1, 1) * directionVariance).Radians(),
             StaticRandom.Float(speed), StaticRandom.Float(0.5f, 1) * lifeTime
             );
     }
 }
Beispiel #6
0
        public Ship(GameState game, Vector2 position,
            IShipController controller, int faction = 0, float acceleration = 5,
            Direction2 direction = default(Direction2), float inverseFriction = 0.8f)
            : base(game)
        {
            this.position = position;
            this.controller = controller;
            this.faction = faction;
            this.acceleration = acceleration;
            this.forwards = direction;
            this.inverseFriction = inverseFriction;
            controller.SetShip(this);

            game.Ships.Add(this);
        }
 public KeyboardShipController(GameState game)
 {
     this.game = game;
 }
Beispiel #8
0
 public ShipFactory(GameState game)
 {
     this.game = game;
 }
Beispiel #9
0
        protected GameObject(GameState game)
        {
            this.game = game;

            game.Add(this);
        }
Beispiel #10
0
 public Cannon(GameState game, Vector2 positionOffset, Angle directionOffset,
         GunControlGroup controlGroup)
     : base(game, positionOffset, directionOffset)
 {
     this.controlGroup = controlGroup;
 }
Beispiel #11
0
 public PositionedEquipment(GameState game, Vector2 positionOffset, Angle directionOffset)
 {
     this.game = game;
     this.positionOffset = positionOffset;
     this.directionOffset = directionOffset;
 }
Beispiel #12
0
 public PlayerView(GameState game, IPositionable parent)
     : base(game)
 {
     this.parent = parent;
 }
Beispiel #13
0
 public static void Create(GameState game, int count, Color color, Vector2 position,
     float speed, float lifeTime)
 {
     Particle.Create(game, count, color, position, Direction2.Zero, Mathf.Pi, speed, lifeTime);
 }
Beispiel #14
0
 public Particle(GameState game, Color color, Vector2 position, Direction2 direction, float speed, float lifeTime)
     : this(game, color, position, direction.Vector * speed, lifeTime)
 {
 }