/// <summary> /// Constructs a new gem. /// </summary> public Gem(Engine level, Vector2 position) { this.level = level; this.basePosition = position; LoadContent(); }
public TileBomb(Engine engine, Vector2 startingPos, int movement) : base(engine) { Movement = movement; Position = startingPos; Hit = false; }
public Bullet(Engine engine, Vector2 startingPos, double rotation, string source) : base(CollisionCheckType.Rectangle,engine) { Rotation = rotation; Position = startingPos; Source = source; //LoadContent(_engine.Content); }
protected GameObject(Engine engine) { _engine = engine; if (_engine.IsInDebugMode) { _debugTex = new Texture2D(_engine.GraphicsDevice, 1, 1); _debugTex.SetData(new[] {Color.Red}); } }
public Crosshair(Engine engine) { _engine = engine; _engine.Camera.CameraMoved += HandleCameraMoved; _position = _engine.Camera.Position; var center = _engine.Camera.ScreenCenter; Mouse.SetPosition((int)center.X, (int)center.Y); _initialState = Mouse.GetState(); }
/// <summary> /// Constructs a new tile. /// </summary> protected Tile(string texture, Vector2 position, TileCollision collision, Engine engine) : base(engine) { Name = texture; Position = position; Collision = collision; }
public DestructableObject(string texture, Vector2 position, CollisionCheckType collisionCheck, Engine engine) : base(collisionCheck, engine) { _textureName = texture; Position = position; }
public DestructableObject(string texture, Vector2 position, Engine engine) : this(texture, position,CollisionCheckType.Rectangle,engine) { }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); _background = content.Load<Texture2D>("Backgrounds/sunset"); _particleEngine = new ParticleEngine(content); _gameEngine = new Engine(ScreenManager.Game.Services, _particleEngine) { GraphicsDevice = ScreenManager.GraphicsDevice }; _camera = new Camera2D(ScreenManager.Game, _gameEngine); _hud = new HUD(_camera); // Load the level. string levelPath = string.Format("Content/Levels/{0}.txt", 0); using (Stream fileStream = TitleContainer.OpenStream(levelPath)) { _gameEngine.Initialize(fileStream, _camera, _hud); _camera.Focus = _gameEngine.Player; _hud.Initialize(content); //todo: implement video setting for postprocessing _postprocessor = new GraphicalPostprocessor(true); _postprocessor.Initialize(ScreenManager.Game); } // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); }
public Level(Engine engine) { _engine = engine; ExitPosition = InvalidPosition; }
public DestructableTile(int life, string name, Vector2 position, TileCollision collision, Engine engine) : base(name, position, collision, engine) { _life = life; }
protected AIControllableObject(Engine engine) : this(CollisionCheckType.Rectangle, engine) { }
public EvilBug(Engine engine) : base(engine) { }
protected CollidableGameObject(CollisionCheckType collisionCheck,Engine engine) : base(engine) { CollCheckLevel = collisionCheck; }
protected CollidableGameObject(Engine engine) : this(CollisionCheckType.Rectangle,engine) { }
/// <summary> /// Constructors a new player. /// </summary> public Player(Engine engine, Vector2 position) : base(engine) { //LoadContent(engine.Content); Reset(position); }
public EvilBug(CollisionCheckType collisionCheck, Engine engine) : base(collisionCheck, engine) { }
public GroundTile(string name, Vector2 position, TileCollision collision, Engine engine) : base(name, position, collision, engine) { }
public Camera2D(Game game, Engine engine) : base(game) { game.Components.Add(this); _engine = engine; _titleSafeArea = new Vector2(); }
protected AIControllableObject(CollisionCheckType collisionCheck, Engine engine) : base(collisionCheck, engine) { }
public Enemy(Engine engine, Vector2 pos) : base(engine) { Position = pos; }