Ejemplo n.º 1
0
        /// <summary>
        /// Loads the hazard texture
        /// </summary>
        public void LoadContent(ContentManager content)
        {
            switch (Type)
            {
            case HazardType.SHORT_CACTUS:
                BaseTexture = content.Load <Texture2D>("Cactus (2)");
                break;

            case HazardType.MEDIUM_CACTUS:
                BaseTexture = content.Load <Texture2D>("Cactus (3)");
                break;

            case HazardType.TALL_CACTUS:
                BaseTexture = content.Load <Texture2D>("Cactus (1)");
                break;

            case HazardType.BUSH:
                BaseTexture = content.Load <Texture2D>("Bush");
                break;

            case HazardType.STONE:
                BaseTexture = content.Load <Texture2D>("Stone");
                break;
            }
            Position     = new Vector2(Constants.GameWidth, Constants.GameHeight - (Constants.TerrainHeight + BaseTexture.Height));
            CollisionBox = new CollisionHelper.BoundingRectangle(Position, new Vector2(BaseTexture.Width, BaseTexture.Height));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new player sprite
 /// </summary>
 /// <param name="position"></param>
 public Player(Vector2 position)
 {
     Position     = position;
     ScaleFactor  = Constants.PlayerScale;
     CollisionBox = new CollisionHelper.BoundingRectangle(Position, Vector2.Zero);
 }