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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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;
   }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线播放| 不卡视频在线看| 亚洲bdsm女犯bdsm网站| 亚洲精品国产a| 一区二区三区在线免费| 亚洲激情在线播放| 亚洲一卡二卡三卡四卡五卡| 亚洲综合久久av| 一区二区三区在线免费观看| 夜夜精品视频一区二区| 丝袜亚洲另类丝袜在线| 秋霞成人午夜伦在线观看| 日本欧美韩国一区三区| 久草在线在线精品观看| 极品少妇一区二区| 成人理论电影网| 91片在线免费观看| 一本大道久久a久久精二百| 91日韩在线专区| 色综合久久久久综合| 色综合久久综合网欧美综合网| av亚洲精华国产精华精| 99国产精品视频免费观看| 成人性生交大合| 成人免费看黄yyy456| 高清国产一区二区三区| 国产69精品久久777的优势| 国产成人午夜高潮毛片| 美腿丝袜在线亚洲一区| 91丨九色丨黑人外教| 99久久精品一区二区| 成人免费高清视频在线观看| 国产精品一区二区不卡| 国内精品国产成人国产三级粉色| 毛片av一区二区| 免费av网站大全久久| 人人精品人人爱| 天天av天天翘天天综合网色鬼国产 | 99riav久久精品riav| 波多野洁衣一区| 91免费观看国产| 欧美午夜精品久久久久久超碰| 在线国产电影不卡| 欧美精品黑人性xxxx| 欧美大片一区二区| 亚洲国产精华液网站w| 中文字幕亚洲区| 国产精品电影一区二区| 夜夜嗨av一区二区三区| 午夜电影网一区| 久久精品国产在热久久| 国内不卡的二区三区中文字幕| 懂色av一区二区三区免费观看| 成人动漫视频在线| 色偷偷久久人人79超碰人人澡| 欧美午夜不卡在线观看免费| 日韩一区二区免费视频| 国产精品三级视频| 亚洲高清不卡在线观看| 久久99国产精品久久| www.日韩精品| 欧美区在线观看| 国产亚洲综合性久久久影院| 1024精品合集| 日本亚洲电影天堂| 国产98色在线|日韩| 欧美天堂一区二区三区| 精品国产免费一区二区三区四区 | 亚洲激情图片小说视频| 日韩高清一区在线| 丁香婷婷综合五月| 欧美三级日韩三级| 国产日产亚洲精品系列| 亚洲国产你懂的| 国产99久久久久久免费看农村| 欧美视频一区二区三区在线观看 | 欧美自拍丝袜亚洲| 精品国产91乱码一区二区三区| 国产精品久久久久久久久动漫 | 免费在线观看精品| 91丝袜美女网| 欧美精品一区二区三区一线天视频| 亚洲视频免费看| 久草中文综合在线| 欧美日韩1区2区| 国产精品久久久久毛片软件| 久久er精品视频| 欧美日韩在线不卡| 亚洲丝袜另类动漫二区| 国产专区综合网| 欧美精品日日鲁夜夜添| 亚洲精品国产a| 国产成人在线电影| 日韩午夜在线播放| 五月天欧美精品| 色婷婷av一区二区三区软件| 欧美国产一区二区在线观看| 日韩中文字幕1| 色屁屁一区二区| 国产日韩精品视频一区| 精品一二三四区| 91精彩视频在线观看| 国产日韩欧美亚洲| 青娱乐精品视频在线| 91福利精品第一导航| 中文字幕免费不卡| 五月激情综合色| 欧美日韩国产片| 亚洲欧美国产毛片在线| 国产一区二区成人久久免费影院 | 欧美亚洲国产一卡| 国产精品成人免费精品自在线观看| 黄网站免费久久| 精品99999| 麻豆91在线播放免费| 欧美精品在线一区二区三区| 一区二区三区毛片| 色88888久久久久久影院野外| 中文字幕亚洲一区二区va在线| 高潮精品一区videoshd| 国产日韩欧美精品电影三级在线| 国内精品在线播放| 久久精品综合网| 国产河南妇女毛片精品久久久| xf在线a精品一区二区视频网站| 蜜桃视频一区二区三区| 日韩欧美激情四射| 久久精品国产亚洲高清剧情介绍| 日韩一区二区在线观看| 乱一区二区av| 久久夜色精品国产欧美乱极品| 国产在线一区观看| 国产视频一区在线播放| 成人动漫在线一区| 亚洲码国产岛国毛片在线| 色av成人天堂桃色av| 天天色图综合网| 欧美成人一级视频| 欧美视频在线观看一区| 亚洲123区在线观看| 欧美日韩高清一区二区| 免费观看一级特黄欧美大片| 精品福利一二区| 精品一区在线看| 久久夜色精品国产欧美乱极品| 国产精品一区二区三区99| 欧美高清在线一区二区| 色婷婷av一区二区三区gif| 亚洲成av人影院在线观看网| 在线看国产一区| 久久精品99国产精品| 国产精品伦理在线| 色先锋aa成人| 老司机一区二区| 中文字幕久久午夜不卡| 欧美视频完全免费看| 老司机精品视频在线| 中文字幕国产精品一区二区| 91国偷自产一区二区使用方法| 午夜天堂影视香蕉久久| 久久综合色8888| 91久久国产最好的精华液| 美腿丝袜亚洲色图| 国产精品久久夜| 7777精品伊人久久久大香线蕉经典版下载 | 欧美专区日韩专区| 日本午夜精品视频在线观看| 亚洲人成伊人成综合网小说| 制服.丝袜.亚洲.中文.综合| 国产一区二区三区不卡在线观看| 亚洲人成网站影音先锋播放| 欧美高清激情brazzers| 丁香激情综合国产| 五月天网站亚洲| 国产精品久久夜| 日韩欧美在线综合网| 91老师国产黑色丝袜在线| 日韩高清中文字幕一区| 亚洲日本在线视频观看| 日韩女优av电影| 一本一本大道香蕉久在线精品 | 免费久久精品视频| 亚洲欧美怡红院| 欧美电影精品一区二区| 色综合天天性综合| 国产乱人伦偷精品视频不卡 | 日韩一区日韩二区| 日韩一区二区精品在线观看| 波多野结衣中文一区| 免费精品视频最新在线| 亚洲伦理在线免费看| 久久婷婷色综合| 精品视频999| 色呦呦国产精品| 国产91精品一区二区麻豆亚洲| 日本中文一区二区三区| 亚洲另类一区二区| 国产精品丝袜黑色高跟| 欧美精品一区二区三区高清aⅴ | 视频一区视频二区在线观看|