Ejemplo n.º 1
0
 public BombProjectile(Texture2D spritesheet, LinkStateMachine stateMachine)
 {
     this.stateMachine   = stateMachine;
     projectileDirection = stateMachine.getDirection();
     if (projectileDirection == Direction.MoveUp)
     {
         xLoc = stateMachine.getXLoc() + bombSizeX / 2;
         yLoc = stateMachine.getYLoc() - bombSizeY;
     }
     else if (projectileDirection == Direction.MoveDown)
     {
         xLoc = stateMachine.getXLoc() + bombSizeX / 2;
         yLoc = stateMachine.getYLoc() + bombSizeY;
     }
     else if (projectileDirection == Direction.MoveLeft)
     {
         xLoc = stateMachine.getXLoc() - bombSizeX;
         yLoc = stateMachine.getYLoc();
     }
     else //MoveRight
     {
         xLoc = stateMachine.getXLoc() + bombSizeX * 2;
         yLoc = stateMachine.getYLoc();
     }
     sourceRectangle      = new Rectangle(129, 185, 8, 15);
     destinationRectangle = new Rectangle(xLoc, yLoc, bombSizeX, bombSizeY);
     frame            = 0;
     this.spritesheet = spritesheet;
 }
 public BrownBoomerangProjectile(Texture2D spritesheet, LinkStateMachine stateMachine)
 {
     this.spritesheet    = spritesheet;
     this.stateMachine   = stateMachine;
     projectileDirection = stateMachine.getDirection();
     if (projectileDirection == Direction.MoveUp)
     {
         xLoc = stateMachine.getXLoc() + xSize / 2;
         yLoc = stateMachine.getYLoc() - ySize;
     }
     else if (projectileDirection == Direction.MoveDown)
     {
         xLoc = stateMachine.getXLoc() + xSize / 2;
         yLoc = stateMachine.getYLoc() + ySize;
     }
     else if (projectileDirection == Direction.MoveLeft)
     {
         xLoc = stateMachine.getXLoc() - xSize;
         yLoc = stateMachine.getYLoc();
     }
     else //MoveRight
     {
         xLoc = stateMachine.getXLoc() + xSize * 2;
         yLoc = stateMachine.getYLoc();
     }
     goBack               = false;
     flip                 = SpriteEffects.None;
     sourceRectangle      = new Rectangle(64, 185, 8, 15);
     destinationRectangle = new Rectangle(xLoc, yLoc, xSize, ySize);
     frame                = 0;
 }
 public CandleFireProjectile(Texture2D spritesheet, LinkStateMachine stateMachine)
 {
     this.stateMachine   = stateMachine;
     projectileDirection = stateMachine.getDirection();
     if (projectileDirection == Direction.MoveUp)
     {
         xLoc = stateMachine.getXLoc();
         yLoc = stateMachine.getYLoc() - candleSize;
     }
     else if (projectileDirection == Direction.MoveDown)
     {
         xLoc = stateMachine.getXLoc();
         yLoc = stateMachine.getYLoc() + candleSize;
     }
     else if (projectileDirection == Direction.MoveLeft)
     {
         xLoc = stateMachine.getXLoc() - candleSize;
         yLoc = stateMachine.getYLoc();
     }
     else //MoveRight
     {
         xLoc = stateMachine.getXLoc() + candleSize;
         yLoc = stateMachine.getYLoc();
     }
     flip                 = false;
     sourceRectangle      = new Rectangle(191, 185, 15, 15);
     destinationRectangle = new Rectangle(xLoc, yLoc, candleSize, candleSize);
     frame                = 0;
     this.spritesheet     = spritesheet;
 }
Ejemplo n.º 4
0
 public Link(Texture2D spriteSheet, ContentManager contentManager)
 {
     stateMachine        = new LinkStateMachine();
     this.contentManager = contentManager;
     linkSpriteSheet     = spriteSheet;
     currentColor        = LinkColor.Green;
     damageFrameCount    = 0;
 }
 public BrownArrowProjectile(Texture2D spritesheet, LinkStateMachine stateMachine)
 {
     this.spritesheet    = spritesheet;
     this.stateMachine   = stateMachine;
     projectileDirection = stateMachine.getDirection();
     if (projectileDirection == Direction.MoveUp)
     {
         xSize = ArrowWidth;
         ySize = ArrowLength;
         xLoc  = stateMachine.getXLoc() + xSize / 2;
         yLoc  = stateMachine.getYLoc() - ySize;
         flip  = SpriteEffects.None;
     }
     else if (projectileDirection == Direction.MoveDown)
     {
         xSize = ArrowWidth;
         ySize = ArrowLength;
         xLoc  = stateMachine.getXLoc() + xSize / 2;
         yLoc  = stateMachine.getYLoc() + ySize;
         flip  = SpriteEffects.FlipVertically;
     }
     else if (projectileDirection == Direction.MoveLeft)
     {
         xSize = ArrowLength;
         ySize = ArrowWidth;
         xLoc  = stateMachine.getXLoc() - xSize;
         yLoc  = stateMachine.getYLoc() + ySize / 2;
         flip  = SpriteEffects.FlipHorizontally;
     }
     else //MoveRight
     {
         xSize = ArrowLength;
         ySize = ArrowWidth;
         xLoc  = stateMachine.getXLoc() + xSize;
         yLoc  = stateMachine.getYLoc() + ySize / 2;
         flip  = SpriteEffects.None;
     }
     if (projectileDirection == Direction.MoveUp || projectileDirection == Direction.MoveDown)
     {
         sourceRectangle = new Rectangle(1, 185, 8, 15);
     }
     else
     {
         sourceRectangle = new Rectangle(10, 188, 15, 8);
     }
     destinationRectangle = new Rectangle(xLoc, yLoc, xSize, ySize);
     frame = 0;
 }
Ejemplo n.º 6
0
 public BlueBoomerangProjectile(Texture2D spritesheet, LinkStateMachine stateMachine)
 {
     this.stateMachine = stateMachine;
     this.spritesheet  = spritesheet;
 }
Ejemplo n.º 7
0
 public SwordProjectile(Texture2D spritesheet, LinkStateMachine stateMachine)
 {
     this.stateMachine = stateMachine;
     this.spritesheet  = spritesheet;
 }