protected override void OnLoad(EventArgs e) { this.renderer = new GameRenderer(); this.game = new GameState(); InputManager.Initialize(null); }
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(); }
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; }
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; }
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 ); } }
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; }
public ShipFactory(GameState game) { this.game = game; }
protected GameObject(GameState game) { this.game = game; game.Add(this); }
public Cannon(GameState game, Vector2 positionOffset, Angle directionOffset, GunControlGroup controlGroup) : base(game, positionOffset, directionOffset) { this.controlGroup = controlGroup; }
public PositionedEquipment(GameState game, Vector2 positionOffset, Angle directionOffset) { this.game = game; this.positionOffset = positionOffset; this.directionOffset = directionOffset; }
public PlayerView(GameState game, IPositionable parent) : base(game) { this.parent = parent; }
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); }
public Particle(GameState game, Color color, Vector2 position, Direction2 direction, float speed, float lifeTime) : this(game, color, position, direction.Vector * speed, lifeTime) { }