Ejemplo n.º 1
0
 public void render(BitmapData bitmapData)
 {
     blit.x = (int)x;
     blit.y = (int)y;
     if (states)
     {
         frame  = over ? 1 : 0;
         frame += active ? 2 : 0;
     }
     blit.render(bitmapData, frame);
 }
Ejemplo n.º 2
0
 public void main()
 {
     if (frame > -1)
     {
         blit.x = (int)((canvasPoint.x) + x);
         blit.y = (int)((canvasPoint.y) + y);
         // just trying to ease the collosal rendering requirements going on
         if (blit.x + blit.dx + blit.width >= 0 &&
             blit.y + blit.dy + blit.height >= 0 &&
             blit.x + blit.dx <= Game.WIDTH &&
             blit.y + blit.dy <= Game.HEIGHT)
         {
             blit.render(bitmapData, frame++);
         }
         else
         {
             frame++;
         }
         if (frame == blit.totalFrames)
         {
             if (looped)
             {
                 frame = 0;
             }
             else
             {
                 active = false;
             }
         }
     }
     else
     {
         frame++;
     }
     if (dir != null)
     {
         x += dir.x;
         y += dir.y;
     }
     if (!renderer.onScreen(x, y, 5) && killOffScreen)
     {
         active = false;
     }
 }