Пример #1
0
 public RedKoopaSprite(int posX, int posY)
 {
     //this.isInShell = isInShell;
     Location    = new Vector2(posX, posY);
     WidthHeight = new Vector2(KoopaSpriteFactory.KOOPA_WIDTH, KoopaSpriteFactory.KOOPA_HEIGHT);
     Boundary    = new Rectangle((int)Location.X, (int)Location.Y, (int)WidthHeight.X, (int)WidthHeight.Y);
     koopaFrame  = KoopaSpriteFactory.Koopa(KoopaColor.Red, KoopaFrame.StartWalkLeft);
     EntityType  = TileMapInterpreter.Entities.RED_KOOPA;
 }
Пример #2
0
 public void Update(GameTime gameTime)
 {
     elapsedFrames += (float)gameTime.ElapsedGameTime.TotalSeconds * 60;
     if (WasHit)
     {
         if (elapsedFrames > 5)
         {
             WasHit        = false;
             elapsedFrames = 0;
         }
     }
     if (elapsedFrames > 5 && elapsedFrames < 10)
     {
         koopaFrame = KoopaSpriteFactory.Koopa(KoopaColor.Red, KoopaFrame.ContinueWalkLeft);
     }
     else if (elapsedFrames > 10)
     {
         koopaFrame    = KoopaSpriteFactory.Koopa(KoopaColor.Red, KoopaFrame.StartWalkLeft);
         elapsedFrames = 0;
     }
 }