Example #1
0
        public Spaceman offsetSpaceMan(Spaceman s, int xOffset, int yOffset)
        {
            Spaceman result = new Spaceman(s.body, s.head, new Vector2((float)s.destRect.X, (float)s.destRect.Y), s.numFrames, s.frameNum, s.mirrorX);

            result.destRect.X += xOffset;
            result.destRect.Y += yOffset;
            return(result);
        }
Example #2
0
 public GunOverlay(Spaceman baseSprite, Texture2D angleUpTexture, Texture2D angleDownTexture, Texture2D flatTexture, Vector2 destCoords, int numFrames, int frameNum,
                   int sizeMultiplier, bool mirrorX, Nullable <int> cycleStart)
     : base(flatTexture, destCoords, numFrames, frameNum, mirrorX)
 {
     this.baseSprite       = baseSprite;
     this.angleUpTexture   = angleUpTexture;
     this.angleDownTexture = angleDownTexture;
     this.flatTexture      = flatTexture;
 }
Example #3
0
 public bool CheckMapCollision(Game1 game, int xOffset, int yOffset)
 {
     if (CollisionDetector.CheckMapCollision(xOffset, yOffset, this, game.worldMap[game.currentRoom]))
     {
         return(true);
     }
     if (game.worldMap[game.currentRoom].assets.Count > 0)
     {
         Spaceman offset = game.worldMap[game.currentRoom].assets[0].offsetSpaceMan(this, xOffset, yOffset);
         foreach (MapAsset asset in game.worldMap[game.currentRoom].assets)
         {
             if (CollisionDetector.RectCollisionDetect(asset, offset))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Example #4
0
        public static bool CheckMapCollision(int xOffset, int yOffset, Spaceman sprite, Map map)
        {
            Rectangle newRect = new Rectangle((int)(sprite.destRect.X + 1), (int)(sprite.destRect.Y + 1), sprite.spriteWidth - 2, sprite.spriteHeight - 1);

            return(MapCollisionDetect(sprite.spriteWidth - 2, sprite.spriteHeight - 1, OffsetRect(newRect, xOffset, yOffset), map));
        }
Example #5
0
 public Projectile CreateProjectile(Spaceman origin, Vector2 mapCoords, double worldX, double worldY)
 {
     return(projectileData.CreateProjectile(origin.direction, origin, mapCoords, worldX, worldY, origin.GetMirrorX()));
 }