Example #1
0
 public ScoreBoard(Texture2D texture, Vector2 position, Trex trex, SoundEffect scoreSfx)
 {
     _texture  = texture;
     _trex     = trex;
     Position  = position;
     _scoreSfx = scoreSfx;
 }
Example #2
0
 public CactusGroup(Texture2D spriteSheet, bool isLarge, GroupSize size, Trex trex, Vector2 position) : base(trex, position)
 {
     IsLarge = isLarge;
     Size    = size;
     // The order matters size needs to be set first
     Sprite = GenerateSprite(spriteSheet);
 }
 public ObstacleManager(EntityManager entityManager, Trex trex, ScoreBoard scoreBoard, Texture2D spriteSheet)
 {
     _entityManager = entityManager;
     _trex          = trex;
     _scoreBoard    = scoreBoard;
     _random        = new Random();
     _spriteSheet   = spriteSheet;
 }
Example #4
0
 public SkyManager(Trex trex, Texture2D spriteSheet, EntityManager entityManager, ScoreBoard scoreBoard)
 {
     _trex          = trex;
     _spriteSheet   = spriteSheet;
     _entityManager = entityManager;
     _scoreBoard    = scoreBoard;
     _random        = new Random();
 }
Example #5
0
        public GroundManager(Texture2D spriteSheet, EntityManager entityManager, Trex trex)
        {
            _spriteSheet   = spriteSheet;
            _entityManager = entityManager;
            _groundTiles   = new List <GroundTile>();

            _regularSprite = new Sprite(spriteSheet, SPRITE_POS_X, SPRITE_POS_Y, SPRITE_WIDTH, SPRITE_HEIGHT);
            _bumpySprite   = new Sprite(spriteSheet, SPRITE_POS_X + SPRITE_WIDTH, SPRITE_POS_Y, SPRITE_WIDTH, SPRITE_HEIGHT);

            _trex   = trex;
            _random = new Random();
        }
Example #6
0
        public FlyingDino(Trex trex, Vector2 position, Texture2D spriteSheet) : base(trex, position)
        {
            Sprite spriteA = new Sprite(spriteSheet, TEXTURE_COORDS_X, TEXTURE_COORDS_Y, SPRITE_WIDTH, SPRITE_HEIGHT);
            Sprite spriteB = new Sprite(spriteSheet, TEXTURE_COORDS_X + SPRITE_WIDTH, TEXTURE_COORDS_Y, SPRITE_WIDTH, SPRITE_HEIGHT);

            _trex = trex;

            _animation = new SpriteAnimation();
            _animation.AddFrame(spriteA, 0);
            _animation.AddFrame(spriteB, ANIMATION_FRAME_LENGTH);
            _animation.AddFrame(spriteA, ANIMATION_FRAME_LENGTH * 2);
            _animation.ShouldLoop = true;
            _animation.Play();
        }
Example #7
0
 public Star(Texture2D spriteSheet, Trex trex, Vector2 position) : base(trex, position)
 {
     _animation = SpriteAnimation.CreateSimpeAnimation(
         spriteSheet,
         new Point(INITIAL_FRAME_TEXTURE_COORDS_X, INITIAL_FRAME_TEXTURE_COORDS_Y),
         SPRITE_WIDTH,
         SPRITE_HEIGHT,
         new Point(0, SPRITE_HEIGHT),
         3,
         ANIMATION_FRAME_LENGTH
         );
     _animation.ShouldLoop = true;
     _animation.Play();
 }
Example #8
0
        public SkyManager(Trex trex, Texture2D spriteSheet, Texture2D invertedSpriteSheet, EntityManager entityManager, ScoreBoard scoreBoard)
        {
            this._entityManager  = entityManager;
            this._scoreBoard     = scoreBoard;
            _random              = new Random();
            this._trex           = trex;
            _spriteSheet         = spriteSheet;
            _invertedSpriteSheet = invertedSpriteSheet;

            _textureData         = new Color[_spriteSheet.Width * _spriteSheet.Height];
            _invertedTextureData = new Color[_invertedSpriteSheet.Width * _invertedSpriteSheet.Height];

            _spriteSheet.GetData(_textureData);
            _invertedSpriteSheet.GetData(_invertedTextureData);

            _overlay = new Texture2D(spriteSheet.GraphicsDevice, 1, 1);
            Color[] overlayData = new[] { Color.Gray };
            _overlay.SetData(overlayData);
        }
Example #9
0
 public Moon(IDayNightCycle dayNightCycle, Texture2D spriteSheet, Trex trex, Vector2 position) : base(trex, position)
 {
     _dayNightCycle = dayNightCycle;
     _sprite        = new Sprite(spriteSheet, RIGHTMOST_SPRITE_COORDS_X, RIGHTMOST_SPRITE_COORDS_Y, SPRITE_WIDTH, SPRITE_HEIGHT);
 }
Example #10
0
 protected Obstacle(Trex trex, Vector2 position)
 {
     _trex    = trex;
     Position = position;
 }
Example #11
0
 public Cloud(Texture2D spriteSheet, Trex trex, Vector2 position) : base(trex, position)
 {
     _sprite = new Sprite(spriteSheet, TEXTURE_COORDS_X, TEXTURE_COORDS_Y, SPRITE_WIDTH, SPRITE_HEIGHT);
 }
Example #12
0
 protected SkyObject(Trex trex, Vector2 position)
 {
     _trex    = trex;
     Position = position;
 }
Example #13
0
 public CactusGroup(Texture2D spriteSheet, bool isLarge, GroupSize size, Trex trex, Vector2 position) : base(trex, position)
 {
     IsLarge = isLarge;
     Size    = size;
     Sprite  = GenerateSprite(spriteSheet);
 }
Example #14
0
 public SkyObject(Trex trex, Vector2 position)
 {
     _trex    = trex;
     Position = position;
 }