亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sprite.java

?? 大量j2me源代碼
?? JAVA
字號:
import javax.microedition.lcdui.Graphics;

/**
 * A state manager for a game sprite. Use in conjunction with an ImageSet in
 * order to draw animated, multi-state sprites. For each instance of an animated
 * graphic you should create one corresponding Sprite object. Graphics are
 * shared using a common ImageSet. To animate you must call this class's cycle
 * method.
 * @author Martin J. Wells
 */
public class Sprite
{
   private int currentFrame;
   private int currentState;
   private long currentStateBegan;		// time this currentState started
   private ImageSet imageSet;
   private long lastFrameChange;
   private int totalCycles;

   /**
    * Constructor for a Sprite object requiring the source image set and the
    * starting state and frame.
    * @param is The imageSet which is the source of graphics for this Sprite.
    * @param startingState The starting state (normally 0).
    * @param startingFrame The starting frame (normally 0).
    */
   public Sprite(ImageSet is, int startingState, int startingFrame)
   {
      imageSet = is;
      setState(startingState, true);
      currentFrame = startingFrame;
   }

   /**
    * Change to a specific frame.
    * @param f The frame to change to.
    */
   public final void setFrame(int f)
   {
      currentFrame = f;
   }

   /**
    * Change to a different state.
    * @param s The state to change to.
    * @param force Normally we wont change change if that is already the current
    * state. However this has the effect of not reseting the state began time
    * and totalCycles counter. Set this to true to force those to be reset.
    */
   public final void setState(int s, boolean force)
   {
      if (currentState != s || force)
      {
         currentState = s;
         currentFrame = 0;
         totalCycles = 0;
         currentStateBegan = System.currentTimeMillis();
      }
   }

   /**
    * Resets all state information such as the current animation frame, total
    * number of completed cycles and the time the state began.
    */
   public final void reset()
   {
      currentFrame = 0;
      totalCycles = 0;
      currentStateBegan = 0;
      lastFrameChange = 0;
   }

   /**
    * Get the time the last state change occurred.
    * @return Time last state was changed in milliseconds since epoch.
    */
   public final long getWhenStateBegan()
   {
      return currentStateBegan;
   }

   /**
    * @return The total time spent in the current state.
    */
   public final long getTimeInCurrentState()
   {
      return (System.currentTimeMillis() - currentStateBegan);
   }

   /**
    * @return The current state.
    */
   public final int getCurrentState()
   {
      return currentState;
   }

   /**
    * @return The current frame number.
    */
   public final int getCurrentFrame()
   {
      return currentFrame;
   }

   /**
    * Draws the current sprite frame onto a specified graphics context.
    * @param target The target to draw the image frame onto.
    * @param targetX The target x position.
    * @param targetY The target y position.
    */
   public final void draw(Graphics target, int targetX, int targetY)
   {
      imageSet.draw(target, currentState, currentFrame, targetX, targetY);
   }

   /**
    * Cycles the current sprites animation and goes forward by the number of
    * frames corresponding to the amount of time that has elapsed.
    * @param deltaMS The amount of time that has passed in milliseconds.
    */
   public final void cycle(long deltaMS)
   {
      // change frame if we are animating (and enough time has passed)
      if (imageSet.getTotalFrames(currentState) > 1 &&
              imageSet.getAnimTime(currentState) > 0)
      {
         long deltaTime = System.currentTimeMillis() - lastFrameChange;
         if (deltaTime > imageSet.getAnimTimePerFrame(currentState))
         {
            currentFrame++;
            lastFrameChange = System.currentTimeMillis();
            if (currentFrame >= imageSet.getTotalFrames(currentState))
            {
               currentFrame = 0;
               totalCycles++;
            }
         }
      }
   }

   /**
    * @return The total number of cycles this sprite has animated through.
    * Very useful for determining if a sprite has finished it's animation.
    */
   public final int getTotalCycles()
   {
      return totalCycles;
   }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一二三| 色综合天天综合色综合av| 欧美日韩激情一区二区三区| 亚洲国产成人午夜在线一区| 久久国产成人午夜av影院| 精品视频色一区| 亚洲一区在线观看网站| 91丨九色丨国产丨porny| 国产精品人妖ts系列视频| 激情欧美一区二区三区在线观看| 制服.丝袜.亚洲.中文.综合| 亚洲电影在线播放| 欧美日韩一级黄| 亚洲国产乱码最新视频| 欧美性xxxxxxxx| 香蕉成人啪国产精品视频综合网| 欧美日韩一区国产| 日日摸夜夜添夜夜添国产精品| 一本色道久久综合狠狠躁的推荐| 亚洲人精品午夜| 色婷婷综合久久久| 亚洲一卡二卡三卡四卡五卡| 欧美日韩国产综合视频在线观看 | 99久久99久久综合| 亚洲日本在线视频观看| 欧美在线免费观看视频| 亚洲国产日韩一级| 欧美成人一区二区三区片免费| 久久av资源站| 国产人成亚洲第一网站在线播放| 成人免费福利片| 亚洲一区二区三区美女| 日韩精品一区二区三区四区| 亚洲一区二区三区三| 欧美一卡2卡三卡4卡5免费| 国内精品写真在线观看| 国产精品欧美一区二区三区| 成人黄色国产精品网站大全在线免费观看| 欧美国产激情二区三区| 99视频精品在线| 亚洲大片精品永久免费| 亚洲精品在线电影| aaa欧美日韩| 天堂av在线一区| 国产欧美日韩精品a在线观看| 91美女视频网站| 青青青伊人色综合久久| 国产欧美一区二区三区沐欲| 91久久精品一区二区三区| 男男成人高潮片免费网站| 久久久美女艺术照精彩视频福利播放| 91免费看`日韩一区二区| 日韩avvvv在线播放| 国产精品网站在线| 欧美喷潮久久久xxxxx| 国产激情一区二区三区四区| 一区二区国产视频| 久久久国产精品麻豆| 欧美老女人第四色| 丁香激情综合国产| 日本不卡视频一二三区| 精品对白一区国产伦| 在线影院国内精品| 国产suv精品一区二区6| 日韩成人免费电影| 国产精品久久久久久久久动漫 | 欧美三区在线视频| 丰满亚洲少妇av| 日韩国产成人精品| 日本一区二区三区四区| 精品欧美乱码久久久久久| 日本丶国产丶欧美色综合| 国产91富婆露脸刺激对白| 日韩电影在线观看网站| 亚洲人成网站在线| 国产亚洲婷婷免费| 日韩午夜av电影| 欧美少妇性性性| 91视频国产资源| 国产另类ts人妖一区二区| 国产毛片精品视频| 日本一不卡视频| 亚洲福利视频导航| 一区二区三区日韩精品视频| 亚洲国产经典视频| 日本一区二区免费在线| www国产成人| 欧美精品一区二区三区很污很色的 | 久久青草欧美一区二区三区| 91精品国产欧美一区二区| 欧美日韩一级片在线观看| 在线看不卡av| 色网站国产精品| 91在线免费看| 99久久精品国产观看| bt7086福利一区国产| 成人白浆超碰人人人人| 盗摄精品av一区二区三区| 国产成人精品一区二| 国产99精品国产| 粉嫩av一区二区三区在线播放| 人人狠狠综合久久亚洲| 亚洲va欧美va人人爽午夜| 亚洲免费视频中文字幕| 国产免费久久精品| 国产精品麻豆网站| 亚洲图片你懂的| 亚洲精品视频免费看| 亚洲小说欧美激情另类| 午夜视频在线观看一区二区三区| 天天免费综合色| 日本三级韩国三级欧美三级| 久久精品国内一区二区三区| 激情亚洲综合在线| 国产成人精品影视| 91女厕偷拍女厕偷拍高清| 欧美性受xxxx| 欧美一级视频精品观看| 欧美精品一区二区三区久久久| 久久影视一区二区| 国产精品国产三级国产aⅴ入口| 一区免费观看视频| 五月激情丁香一区二区三区| 免费成人在线播放| 成人精品免费视频| 欧美熟乱第一页| 欧美v亚洲v综合ⅴ国产v| 国产欧美日韩卡一| 亚洲一二三四在线| 韩国欧美一区二区| 91色|porny| 日韩欧美在线1卡| 国产精品不卡一区| 午夜国产精品一区| 国产成人免费视频网站| 欧美影院一区二区三区| 欧美xxxxx牲另类人与| 亚洲色图欧洲色图婷婷| 美女视频黄频大全不卡视频在线播放| 国产专区欧美精品| 色吧成人激情小说| 精品国产123| 一区二区三区.www| 国产精品亚洲一区二区三区在线| 色婷婷综合久久久中文一区二区| 欧美一级欧美三级在线观看| 国产精品久久三区| 麻豆精品精品国产自在97香蕉 | 亚洲女同一区二区| 蜜臀av一区二区三区| 一本一本久久a久久精品综合麻豆| 在线电影一区二区三区| 欧美二区乱c少妇| 国产清纯白嫩初高生在线观看91| 亚洲成人福利片| 99久久99久久精品免费观看 | 午夜精品一区二区三区三上悠亚| 国产一区二区三区黄视频 | 一区二区国产视频| 国产激情一区二区三区| 91精品综合久久久久久| 亚洲人成网站色在线观看| 经典三级在线一区| 欧美欧美欧美欧美首页| 亚洲美女淫视频| 成人免费毛片aaaaa**| 欧美丰满一区二区免费视频 | 亚洲欧美日韩电影| 精品伊人久久久久7777人| 91免费在线视频观看| 欧美精品一区二区三区很污很色的| 国产精品婷婷午夜在线观看| 麻豆91在线看| 51精品国自产在线| 亚洲一区二区视频| 一本一道波多野结衣一区二区| 国产欧美日韩亚州综合 | 欧美aaa在线| 日韩一区二区三区观看| 久久精品国产亚洲aⅴ| 26uuu亚洲| 成人影视亚洲图片在线| 亚洲人被黑人高潮完整版| 91福利视频在线| 五月天激情综合| 精品福利一区二区三区 | 伦理电影国产精品| 久久精品一区四区| 99久久777色| 亚洲成a天堂v人片| 久久综合久久综合亚洲| 成人自拍视频在线| 亚洲影院久久精品| 精品日韩成人av| proumb性欧美在线观看| 午夜影视日本亚洲欧洲精品| 精品欧美一区二区三区精品久久| 国产91精品精华液一区二区三区 | 亚洲精品视频在线看| 欧美猛男超大videosgay|