public Enemy(GameController game, int X, int Y, string type, Random random)
 {
     _random = random;
     _game   = game;
     Type    = type;
     if (type == "soldier")
     {
         Texture = new _2DTexture(game.Content.Load <Texture2D>("enemies/soldier"), GameController.scale);
         rupees  = 1;
     }
     else if (type == "archer")
     {
         Texture = new _2DTexture(game.Content.Load <Texture2D>("enemies/archer"), GameController.scale);
         rupees  = 3;
     }
     else if (type == "wizard")
     {
         Texture = new _2DTexture(game.Content.Load <Texture2D>("enemies/firewiz"), GameController.scale);
         rupees  = 5;
     }
     Texture._scale = 2;
     Position       = new Vector2(X, Y);
     game.Enemies.Add(this);
     Powerup = GetPowerup();
     top     = new Rectangle(X, Y, Texture.GetWidth(), 1);
     bot     = new Rectangle(X, Y + (Texture.GetHeight() - 1), Texture.GetWidth(), 1);
     left    = new Rectangle(X, Y, 1, Texture.GetHeight());
     bot     = new Rectangle(X + (Texture.GetWidth() - 1), Y, 1, Texture.GetHeight());
 }
Exemple #2
0
 public Player(GameController game, int rupees, int arrowCount = 0, int bombCount = 0, int lives = 0) : base(2f)
 {
     _game          = game;
     ArrowCount     = arrowCount;
     BombCount      = bombCount;
     RupeeCount     = rupees;
     LifeCount      = lives;
     throwAni       = new AnimatedTexture(Position, 0, 2, 0.5f);
     Texture        = new _2DTexture(game.Content.Load <Texture2D>("player/linkidle" + (GameController.Difficulty == "Normal" ? "" : "small")), GameController.scale);
     throwIdle      = new _2DTexture(game.Content.Load <Texture2D>("player/linkidlewithboom"), 2);
     Texture._scale = 2;
     Position       = new Vector2((GameController.ScreenWidth / 2) - (Texture.GetWidth() / 2), GameController.ScreenHeight - game.environment.HorWallTile.GetHeight() - (int)(GameController.ScreenHeight * 0.01) - Texture.GetHeight());
     animatedTexture.Load(game.Content, "player/linkwithpaddle" + (GameController.Difficulty == "Normal" ? "" :"small"), Frames, FramesPerSec);
     throwAni.Load(game.Content, "player/linkwithboom", Frames, FramesPerSec);
     shield = new Rectangle((int)Position.X, (int)Position.Y, Texture.GetWidth(), 8);
 }