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

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

?? sprite.java

?? 《J2ME Game Programming》隨書光盤源代碼
?? 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一区二区三区免费野_久草精品视频
欧美自拍偷拍午夜视频| 91精品免费在线观看| 欧美日韩在线观看一区二区 | 91久久精品一区二区三区| 欧美精品1区2区3区| 中文字幕中文乱码欧美一区二区 | 国产91富婆露脸刺激对白| 欧美高清一级片在线| 国产精品福利电影一区二区三区四区| 亚洲成人免费av| 97精品视频在线观看自产线路二| 精品免费一区二区三区| 日韩成人精品在线| 欧美人成免费网站| 亚洲制服丝袜一区| 色噜噜偷拍精品综合在线| 国产丝袜美腿一区二区三区| 免费看欧美女人艹b| 欧美日韩一区 二区 三区 久久精品| 国产精品福利一区二区| 成人午夜免费av| 国产午夜精品在线观看| 国产一区二区三区四区五区入口| 91精品国产免费| 亚洲成人综合在线| 欧美日高清视频| 性做久久久久久久久| 欧洲国内综合视频| 亚洲午夜久久久久久久久电影网| 色婷婷香蕉在线一区二区| 亚洲免费av观看| 欧美在线三级电影| 亚洲图片有声小说| 欧美日韩中文精品| 日本午夜一区二区| 精品国产电影一区二区| 韩国一区二区三区| 国产精品久久久久桃色tv| 成人动漫视频在线| 一区二区在线免费观看| 欧美系列亚洲系列| 秋霞午夜av一区二区三区| 日韩欧美国产一区二区在线播放| 精品一区二区日韩| 精品国产一区二区三区四区四| 免费高清视频精品| 久久久精品一品道一区| 不卡的av网站| 亚洲第一在线综合网站| 欧美一区二区三区四区在线观看 | 亚洲 欧美综合在线网络| av一区二区三区黑人| 亚洲一区在线观看免费观看电影高清| 日韩精品一区二区三区老鸭窝| 午夜精品福利一区二区蜜股av| 在线不卡一区二区| 国产精品2024| 亚洲精品视频自拍| 日韩一区二区三区四区| 国产美女娇喘av呻吟久久| 中文字幕免费不卡在线| 欧美色欧美亚洲另类二区| 久久精品免费观看| 国产精品成人免费| 欧美日韩国产bt| 国产成人8x视频一区二区| 亚洲午夜三级在线| 久久久久亚洲蜜桃| 欧美群妇大交群中文字幕| 国产精品系列在线观看| 香蕉久久一区二区不卡无毒影院 | 欧美一级黄色片| 国产99久久精品| 三级影片在线观看欧美日韩一区二区 | 日韩一区二区三区高清免费看看| 国产麻豆成人精品| 污片在线观看一区二区| 国产精品天美传媒沈樵| 日韩亚洲电影在线| 在线亚洲欧美专区二区| 国产麻豆视频一区二区| 偷拍一区二区三区| 综合色中文字幕| 久久精品日产第一区二区三区高清版 | 在线免费观看日本一区| 国产精品一区三区| 人人爽香蕉精品| 一区二区三区四区在线免费观看| 国产香蕉久久精品综合网| 日韩一区二区高清| 欧美人妇做爰xxxⅹ性高电影| 99天天综合性| 成人免费毛片片v| 麻豆精品新av中文字幕| 亚洲成av人片在线| 亚洲免费伊人电影| 亚洲人成人一区二区在线观看 | 国产精品久久夜| 精品少妇一区二区三区日产乱码| 欧美亚洲动漫精品| 欧美专区日韩专区| 91九色最新地址| 日本精品免费观看高清观看| 成人激情视频网站| 成熟亚洲日本毛茸茸凸凹| 激情国产一区二区| 黑人巨大精品欧美黑白配亚洲| 卡一卡二国产精品 | 亚洲综合自拍偷拍| 亚洲精选在线视频| 亚洲天堂免费看| 亚洲精品视频在线观看免费| 亚洲男同性恋视频| 亚洲色图都市小说| 一区二区理论电影在线观看| 中文字幕一区二区在线播放| 中文字幕一区二区三区四区| 国产精品免费视频一区| 中文在线资源观看网站视频免费不卡| 久久久噜噜噜久久中文字幕色伊伊| 日韩欧美一区电影| 久久色在线观看| 国产亚洲欧美日韩俺去了| 日本一区二区三区在线不卡| 中文字幕第一区二区| 中文字幕一区二区三区色视频| 亚洲激情成人在线| 五月天国产精品| 国产剧情在线观看一区二区| 国产精品一品二品| 91在线视频免费91| 欧美吞精做爰啪啪高潮| 欧美一区二区三区啪啪| 欧美精品一区二区三区蜜桃 | 日本丰满少妇一区二区三区| 欧美私人免费视频| 日韩精品最新网址| 国产精品夫妻自拍| 午夜视频一区在线观看| 精品一区二区三区在线播放| 国产99精品国产| 欧美三级电影网| 26uuu久久综合| 亚洲少妇最新在线视频| 日韩高清中文字幕一区| 国产精品456露脸| 精品视频一区二区三区免费| 亚洲精品一区二区在线观看| 亚洲另类一区二区| 极品美女销魂一区二区三区免费| 成人性色生活片| 91精品福利在线一区二区三区 | 久久日一线二线三线suv| 亚洲视频免费在线| 精品在线免费观看| 一本大道久久a久久精二百| 日韩欧美一区二区三区在线| 国产精品国产三级国产aⅴ无密码| 亚洲www啪成人一区二区麻豆| 韩国三级中文字幕hd久久精品| 色欧美日韩亚洲| 久久女同性恋中文字幕| 天堂在线一区二区| 99精品欧美一区二区三区综合在线| 欧美一区二区三区的| 亚洲天天做日日做天天谢日日欢| 韩国理伦片一区二区三区在线播放| 91国在线观看| 国产精品国产自产拍高清av王其| 日韩av中文字幕一区二区三区| av一区二区不卡| 国产日产欧产精品推荐色| 日韩精品免费视频人成| 色94色欧美sute亚洲线路一ni| 久久精品一区二区三区av| 日韩黄色免费电影| 91国内精品野花午夜精品| 国产精品美女一区二区| 国内精品久久久久影院薰衣草 | 久久99精品久久久| 欧美三级视频在线播放| 亚洲乱码国产乱码精品精可以看| 丁香婷婷综合色啪| 久久综合九色综合97婷婷| 蜜臀av一区二区在线免费观看| 日本韩国欧美在线| 亚洲免费av高清| 色国产综合视频| 亚洲激情自拍偷拍| 一本一道综合狠狠老| 国产精品久久久久久妇女6080| 国产激情一区二区三区桃花岛亚洲| 欧美精品在欧美一区二区少妇| 亚洲综合视频在线观看| 欧美亚日韩国产aⅴ精品中极品| 亚洲精品乱码久久久久久黑人| 97久久精品人人澡人人爽| 亚洲欧美日韩国产中文在线| 9l国产精品久久久久麻豆| 亚洲美女偷拍久久|