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

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

?? sprite.java

?? 此文件是關于手機游戲開發的理論
?? 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| 国产一区二区在线电影| 久久久久久久久久美女| 成人免费视频播放| 亚洲精品免费播放| 欧美日韩情趣电影| 日本亚洲天堂网| 久久久久久久久久看片| 99久久久精品| 秋霞午夜鲁丝一区二区老狼| 日韩精品一区二区三区在线 | 色偷偷一区二区三区| 国产精品66部| 成人黄色网址在线观看| 91在线视频播放| 欧美日韩中字一区| 精品久久久久av影院| 欧美国产1区2区| 亚洲高清久久久| 国产自产高清不卡| 成人晚上爱看视频| 欧美性xxxxxx少妇| 精品国产乱码久久久久久闺蜜| 国产欧美视频一区二区| 午夜精品视频在线观看| 精品一区二区三区免费播放| 暴力调教一区二区三区| 欧美日韩激情一区二区三区| 精品国内二区三区| 亚洲黄色片在线观看| 激情成人综合网| 欧美亚洲一区二区三区四区| 精品奇米国产一区二区三区| 亚洲视频一区在线观看| 美女在线观看视频一区二区| av中文字幕一区| 欧美成人性战久久| 一区二区在线免费| 国产精品2024| 欧美丰满少妇xxxbbb| 欧美韩国日本不卡| 麻豆91精品91久久久的内涵| 色屁屁一区二区| 国产精品女上位| 国产一区二区美女| 日韩欧美卡一卡二| 婷婷六月综合网| 色菇凉天天综合网| 国产精品天天看| 国产91色综合久久免费分享| 欧美日韩国产免费| 亚洲欧洲制服丝袜| www.亚洲人| 欧美激情综合五月色丁香| 美女视频网站黄色亚洲| 欧美日韩国产另类一区| 一区二区成人在线| 99久久99久久精品免费观看| 在线亚洲一区二区| 色诱亚洲精品久久久久久| 粉嫩av亚洲一区二区图片| 国产精品白丝jk白祙喷水网站| 麻豆中文一区二区| 国产午夜精品一区二区| 黄网站免费久久| 国产精品三级电影| 欧美一区二区三区免费观看视频| 久国产精品韩国三级视频| 亚洲精品免费在线| 91精品午夜视频| 欧美伊人久久久久久午夜久久久久| 午夜伦欧美伦电影理论片| 久久噜噜亚洲综合| 久久综合九色综合久久久精品综合 | 国产精品亚洲一区二区三区妖精| 国产日韩欧美一区二区三区乱码 | 国内精品免费在线观看| 久久免费美女视频| 日韩电影免费在线观看网站| 欧美一区二区三区视频免费 | 国产精品丝袜久久久久久app| 久久66热偷产精品| 亚洲精品一区二区三区蜜桃下载 | 最近日韩中文字幕| 9久草视频在线视频精品| 日韩美女啊v在线免费观看| 成人蜜臀av电影| 亚洲综合久久久| 麻豆91在线播放免费| 午夜在线成人av| 秋霞午夜av一区二区三区| 激情丁香综合五月| 不卡欧美aaaaa| 在线精品观看国产| 正在播放一区二区| 欧美r级电影在线观看| 国产日韩成人精品| 亚洲三级在线看| 日韩电影在线一区二区三区| 久久99国产精品尤物| 日韩欧美色综合| 亚洲福利电影网| 蜜臀久久久99精品久久久久久| 乱一区二区av| 成人黄色大片在线观看| 欧美专区日韩专区| 日韩三级伦理片妻子的秘密按摩| 久久久www成人免费毛片麻豆| 在线电影欧美成精品| 日韩精品一卡二卡三卡四卡无卡| 91视频国产观看| 欧美午夜在线一二页| 日韩欧美的一区| 亚洲欧洲色图综合| 秋霞午夜av一区二区三区| 成人午夜碰碰视频| 青青草成人在线观看| 日韩一级黄色片| 欧洲一区二区三区在线| 国产91综合网| 美女被吸乳得到大胸91| 伊人色综合久久天天| 中文字幕的久久| 日韩一区二区三区三四区视频在线观看| hitomi一区二区三区精品| 亚洲美女视频在线观看| 国产成人亚洲综合a∨猫咪| 欧美亚洲国产一区二区三区| 久久久亚洲高清| 成人av在线看| 免费在线观看不卡| 亚洲一二三四久久| 国产精品久久久久久久久搜平片 | 欧美精品一卡二卡| 亚洲国产成人高清精品| 日本怡春院一区二区| 欧美伊人久久大香线蕉综合69| 国产女人水真多18毛片18精品视频 | 高清国产一区二区三区| 日韩三级中文字幕| 亚洲午夜久久久久| 95精品视频在线| 国产欧美日韩另类视频免费观看 | 91精品国产一区二区人妖| 91久久精品一区二区| 91丝袜呻吟高潮美腿白嫩在线观看| 久久99精品久久久久久国产越南 | 日韩视频免费直播| 亚洲国产日韩在线一区模特| 99精品视频中文字幕| 中文字幕欧美国产| 国产91精品入口| 久久免费视频一区| 国产主播一区二区| 精品国产a毛片| 韩国av一区二区三区四区| 亚洲欧美日韩国产手机在线| 国产亚洲美州欧州综合国| 中文字幕第一区综合| 亚洲女女做受ⅹxx高潮| 亚洲午夜久久久久久久久电影网 | 国产精品视频观看| 亚洲视频一区二区在线| 亚洲最大色网站| 午夜久久久影院| 中文字幕久久午夜不卡| 日韩av网站免费在线| 欧美一卡2卡三卡4卡5免费| 日韩成人一级片| 精品电影一区二区三区| 激情av综合网| 中文久久乱码一区二区| 93久久精品日日躁夜夜躁欧美| 亚洲精品成人天堂一二三| 欧美在线一二三| 美女视频免费一区| 精品国产人成亚洲区| 国产成人免费av在线| 最新国产の精品合集bt伙计| 色美美综合视频| 天天做天天摸天天爽国产一区 | 国产一区二区久久| 国产精品欧美极品| 欧美性受xxxx黑人xyx性爽| 日韩精品五月天| 久久一留热品黄| 99久久国产免费看| 视频在线观看国产精品| 精品国产伦一区二区三区免费 | 91首页免费视频| 99精品1区2区| 日本成人中文字幕在线视频 | 国产精品网站在线播放| 91免费精品国自产拍在线不卡 | 日韩理论电影院| 精品视频一区二区三区免费|