Beispiel #1
0
 public Entity(Vector2 position, int health, bool speed, GameSprite sprite, ContentManager content, MovementStrategy movement, ShootingStrategy shooting)
 {
     this.position = position;
     this.health   = health;
     this.speed    = speed;
     this.Texture  = sprite.texture;
     this.sprite   = sprite;
     this.content  = content;
     //creating a new instance of the movements class so all the character classes inherits from this doesn't have a create a new instance every time
     characterMovements = movement;
     characterShooting  = shooting;
     isAlive            = true;
 }
Beispiel #2
0
 /// <summary>
 /// Take a shot...
 /// </summary>
 /// <returns></returns>
 public Coordinates GetShot()
 {
     return(ShootingStrategy.GetShot());
 }
 public Boss(Vector2 position, Vector2 end, int health, bool speed, GameSprite sprite, ContentManager content, MovementStrategy movement, ShootingStrategy shooting) : base(position, health, speed, sprite, content, movement, shooting)
 {
     position   = new Vector2(0, 0);
     health     = 25;
     speed      = false;
     start.X    = sprite.position.X; //setting up enemy start point
     start.Y    = sprite.position.Y; //setting up enemy start point
     this.end.X = end.X;             //setting up enemy start point
     this.end.Y = end.Y;             //setting up enemy start point
 }
 public FinalBoss(Vector2 position, Vector2 end, int fHealth, bool speed, GameSprite sprite, Texture2D newBulletTexture, ContentManager content, MovementStrategy movement, ShootingStrategy shooting) : base(position, end, fHealth, speed, sprite, content, movement, shooting)
 {
     position      = new Vector2(0, 0);
     health        = fHealth;
     speed         = false;
     start.X       = sprite.position.X; //setting up enemy start point
     start.Y       = sprite.position.Y; //setting up enemy start point
     this.end.X    = end.X;             //setting up enemy start point
     this.end.Y    = end.Y;             //setting up enemy start point
     bulletTexture = newBulletTexture;
 }
Beispiel #5
0
 /// <summary>Sets the policy of taking screenshot.</summary>
 /// <param name="strategy">shooting strategy</param>
 /// <returns>this</returns>
 /// <seealso cref="AShotNet.ScreenTaker.ShootingStrategy" />
 public virtual AShot ShootingStrategy(ShootingStrategy strategy)
 {
     this.taker.withShootingStrategy(strategy);
     return(this);
 }
Beispiel #6
0
        public Player(Vector2 position, int pHealth, bool speedMode, GameSprite sprite, Texture2D bulletTexture, ContentManager content, MovementStrategy movement, ShootingStrategy shooting) : base(position, pHealth, speedMode, sprite, content, movement, shooting)
        {
            if (speed)
            {
                speedRate = 5;
            }
            else
            {
                speedRate = 10;
            }

            health = pHealth;

            this.bulletTexture      = bulletTexture;
            this.characterMovements = movement;
            this.characterShooting  = shooting;
        }
Beispiel #7
0
        public Player(Vector2 startPos, Vector2 endPos, int pHealth, bool speedMode, GameSprite sprite, Texture2D bulletTexture, ContentManager content, MovementStrategy movement, ShootingStrategy shooting) : base(startPos, pHealth, speedMode, sprite, content, movement, shooting)
        {
            powerUpActivated = false;
            if (speed)
            {
                speedRate = 5;
            }
            else
            {
                speedRate = 10;
            }

            health                  = pHealth;
            this.bulletTexture      = bulletTexture;
            this.characterMovements = movement;
            this.characterShooting  = shooting;
            inDanger                = false;
        }