亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
波多野结衣中文字幕一区 | 欧美mv日韩mv国产| 欧美最猛性xxxxx直播| 99久久国产综合精品女不卡| 风流少妇一区二区| 成人免费毛片aaaaa**| 国产成人av自拍| 高清不卡一区二区| www.欧美色图| 91国产福利在线| 欧美日韩免费一区二区三区视频| 欧美午夜影院一区| 欧美精品黑人性xxxx| 欧美一区二区三区系列电影| 日韩网站在线看片你懂的| 亚洲精品在线三区| 国产精品护士白丝一区av| 国产精品不卡在线| 亚洲欧美日韩人成在线播放| 亚洲国产一区二区a毛片| 日本中文字幕一区二区视频 | 日本黄色一区二区| 欧美日韩国产中文| 欧美一级专区免费大片| 精品国产伦一区二区三区观看方式 | 亚洲精品久久久蜜桃| 亚洲欧美国产77777| 无码av免费一区二区三区试看| 日韩av一区二| 国产成人精品一区二区三区四区| 成人看片黄a免费看在线| 色呦呦网站一区| 日韩欧美成人午夜| 中文字幕一区av| 婷婷六月综合亚洲| 国产精品69久久久久水密桃| 色综合天天综合给合国产| 91精品中文字幕一区二区三区| 久久久国产精品午夜一区ai换脸 | 成人一区二区三区视频| 色94色欧美sute亚洲13| 欧美一级高清片| 国产精品毛片无遮挡高清| 亚洲国产成人91porn| 精品一区二区免费在线观看| 99r国产精品| 精品日韩99亚洲| 亚洲精品日韩一| 精品一区二区影视| 欧美综合视频在线观看| 久久久久久久久伊人| 亚洲一区在线电影| 国产精品一区一区| 欧美精品99久久久**| 国产欧美一区二区精品秋霞影院| 亚洲精品午夜久久久| 国产尤物一区二区| 欧美日韩亚洲综合| 日本一区二区不卡视频| 男女性色大片免费观看一区二区| eeuss鲁片一区二区三区 | 91精品国产麻豆| 成人免费在线视频| 欧美亚洲高清一区二区三区不卡| 亚洲天堂a在线| 国内精品国产三级国产a久久| 9i在线看片成人免费| 欧美精品久久99久久在免费线| 国产婷婷色一区二区三区在线| 无吗不卡中文字幕| 色综合色狠狠综合色| 国产亚洲精品免费| 九九久久精品视频| 欧美日韩免费一区二区三区 | 精品国产免费人成电影在线观看四季 | 日韩一区二区麻豆国产| 一区二区三区影院| 成人久久视频在线观看| 久久综合狠狠综合久久激情| 日韩国产精品91| 欧美性受xxxx黑人xyx性爽| ㊣最新国产の精品bt伙计久久| 国产精品影视天天线| 日韩欧美国产不卡| 日韩一区精品视频| 欧美唯美清纯偷拍| 亚洲一区二区在线播放相泽| 白白色亚洲国产精品| 中文字幕不卡一区| 成人免费视频一区二区| 久久久五月婷婷| 久久成人麻豆午夜电影| 欧美一区二区三区色| 亚洲v精品v日韩v欧美v专区| 色婷婷国产精品综合在线观看| 国产精品三级av| 99久久婷婷国产综合精品电影| 中文字幕高清不卡| 国产98色在线|日韩| 久久综合色鬼综合色| 精品制服美女丁香| 日韩欧美不卡在线观看视频| 日韩不卡手机在线v区| 欧美一区二区视频在线观看 | 免费观看在线综合色| 91精品国产一区二区三区蜜臀| 日韩影院免费视频| 日韩欧美不卡在线观看视频| 日本不卡视频一二三区| 日韩免费观看高清完整版| 美腿丝袜一区二区三区| 久久综合色婷婷| 欧美一区二区视频在线观看2022| 喷水一区二区三区| 精品国产免费一区二区三区四区| 国产精品正在播放| 国产精品久久一卡二卡| 色天使久久综合网天天| 亚洲成人av福利| 欧美一区二区日韩| 国产一区二区美女| 中文字幕一区二区三区不卡在线| av午夜一区麻豆| 亚洲成人免费av| 精品国产乱子伦一区| 国产不卡视频在线播放| 中文字幕色av一区二区三区| 欧美亚洲另类激情小说| 麻豆精品一区二区综合av| 国产视频911| 欧美最新大片在线看| 日本成人在线电影网| 久久久美女艺术照精彩视频福利播放| 粉嫩13p一区二区三区| 亚洲色欲色欲www| 欧美影院午夜播放| 日韩精品福利网| 国产精品亲子伦对白| 欧美日韩国产成人在线免费| 精品一区二区av| 亚洲精品乱码久久久久久久久 | 91黄色在线观看| 青青国产91久久久久久| 欧美韩国日本不卡| 欧美探花视频资源| 国产在线一区观看| 夜夜嗨av一区二区三区| 日韩精品一区二区三区老鸭窝| 不卡av电影在线播放| 日韩av不卡在线观看| 欧美国产一区二区| 欧美日韩国产综合久久| 国产精品一二三区在线| 亚洲大片一区二区三区| 国产欧美视频一区二区三区| 在线精品视频免费观看| 国产在线乱码一区二区三区| 一区二区三区高清不卡| www成人在线观看| 欧美性一区二区| 成人在线综合网站| 日韩成人伦理电影在线观看| 国产精品伦理一区二区| 日韩精品影音先锋| 色婷婷国产精品| 国产91在线观看| 蜜臀精品久久久久久蜜臀| 粗大黑人巨茎大战欧美成人| 首页综合国产亚洲丝袜| 中文字幕视频一区| 久久五月婷婷丁香社区| 欧美日本韩国一区二区三区视频| 成人av网址在线观看| 精品一区二区三区蜜桃| 五月开心婷婷久久| 亚洲乱码国产乱码精品精的特点| 亚洲精品在线网站| 91精品国产91综合久久蜜臀| 色综合婷婷久久| 国产成人av网站| 国精产品一区一区三区mba桃花 | 综合久久久久久| 日本一区二区动态图| 337p日本欧洲亚洲大胆精品 | 久久在线观看免费| 日韩欧美国产精品| 欧美日韩三级在线| 色天天综合久久久久综合片| www.亚洲在线| 国产99久久久国产精品潘金网站| 热久久国产精品| 丝袜美腿亚洲综合| 亚洲丰满少妇videoshd| 亚洲精品福利视频网站| 中文字幕一区二区5566日韩| 中文字幕乱码一区二区免费| 久久久精品免费免费| 亚洲精品一线二线三线无人区| 日韩视频免费直播| 日韩一级大片在线|