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

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

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线播放| 国产精品一区二区你懂的| 激情五月激情综合网| jvid福利写真一区二区三区| 欧美日韩精品高清| 欧美韩国日本不卡| 麻豆视频一区二区| 91成人免费网站| 国产精品福利一区| 激情五月婷婷综合| 欧美一区二区三区在线观看| 国产精品免费视频网站| 激情亚洲综合在线| 日韩亚洲欧美中文三级| 亚洲国产日日夜夜| 色狠狠av一区二区三区| 中文字幕亚洲精品在线观看| 国产自产2019最新不卡| 亚洲精品在线网站| 秋霞午夜鲁丝一区二区老狼| 欧美日韩精品高清| 亚洲第一在线综合网站| 色美美综合视频| 自拍偷拍欧美精品| 91在线国产观看| 国产精品国产三级国产aⅴ无密码| 久久国产精品72免费观看| 3atv在线一区二区三区| 婷婷综合在线观看| 在线不卡一区二区| 天天亚洲美女在线视频| 欧美日韩黄色影视| 日本女优在线视频一区二区| 欧美日韩极品在线观看一区| 亚瑟在线精品视频| 91精品在线免费观看| 青青草97国产精品免费观看| 欧美绝品在线观看成人午夜影视| 一区二区三区中文字幕在线观看| 色屁屁一区二区| 亚洲一区二区三区国产| 欧美日韩极品在线观看一区| 午夜精品在线看| 欧美电影免费观看高清完整版| 精一区二区三区| 国产日韩三级在线| 99国产欧美久久久精品| 亚洲成人中文在线| 日韩精品资源二区在线| 91久久人澡人人添人人爽欧美| 国产精品成人网| 色88888久久久久久影院野外| 亚洲电影一区二区| 欧美一二三区在线观看| 国产福利一区二区三区在线视频| 国产精品污www在线观看| 91玉足脚交白嫩脚丫在线播放| 一区二区三区小说| 日韩一区二区免费高清| 国产91精品欧美| 亚洲人成网站影音先锋播放| 欧美日韩国产综合一区二区三区 | 欧美亚洲综合在线| 五月婷婷色综合| 久久久久综合网| 精品视频在线视频| 国内成人精品2018免费看| 国产精品白丝在线| 日韩一级高清毛片| 成人免费视频caoporn| 亚洲一区二区三区四区中文字幕| 日韩一区二区三| 91国偷自产一区二区开放时间 | 亚洲欧美激情插| 日韩精品自拍偷拍| 日本精品免费观看高清观看| 国产资源在线一区| 亚洲国产日产av| 欧美国产禁国产网站cc| 欧美高清性hdvideosex| av男人天堂一区| 另类小说综合欧美亚洲| 亚洲综合在线免费观看| 久久久国产午夜精品| 666欧美在线视频| www.激情成人| 久久99精品一区二区三区 | 欧美一区二区视频观看视频| 不卡视频一二三| 久久99日本精品| 婷婷综合另类小说色区| 亚洲欧洲制服丝袜| 中文一区在线播放| 26uuu欧美| 欧美一区二区三区成人| 日本高清无吗v一区| 成人av在线观| 国产91综合一区在线观看| 麻豆91在线观看| 视频在线观看91| 亚洲国产婷婷综合在线精品| 国产精品国产精品国产专区不片| 欧美va亚洲va国产综合| 777久久久精品| 欧美日韩一区二区三区高清| 97久久超碰国产精品| caoporen国产精品视频| 国产综合久久久久久久久久久久| 奇米色777欧美一区二区| 污片在线观看一区二区| 亚洲成人自拍一区| 三级一区在线视频先锋| 亚洲午夜精品一区二区三区他趣| 亚洲精品乱码久久久久久黑人| 欧美激情中文字幕| 日本视频免费一区| 亚洲精品视频一区| 欧美剧在线免费观看网站| 色偷偷88欧美精品久久久| www亚洲一区| 精品国产免费人成电影在线观看四季| 欧美三级视频在线播放| 捆绑调教美女网站视频一区| 成人美女视频在线观看| 欧美顶级少妇做爰| 亚洲国产精品精华液ab| 天天av天天翘天天综合网色鬼国产| 国产精品一区二区视频| 欧美日韩小视频| 国产精品视频一二三| 日韩电影在线免费| 日韩亚洲欧美在线观看| 亚洲综合精品自拍| 国产成人av福利| 欧美一区二区成人| 一区二区三区欧美在线观看| 韩国三级电影一区二区| 欧美丰满少妇xxxxx高潮对白| 国产精品第一页第二页第三页| 九一九一国产精品| 欧美日韩日日骚| 一区二区三区日韩精品视频| 丁香亚洲综合激情啪啪综合| 欧美电影免费观看高清完整版| 亚洲五码中文字幕| 99视频精品在线| 中文字幕av一区 二区| 极品少妇xxxx精品少妇| 制服丝袜一区二区三区| 亚洲va中文字幕| 欧美午夜片在线观看| 亚洲人妖av一区二区| 粉嫩蜜臀av国产精品网站| 亚洲精品一区二区三区蜜桃下载 | 国产欧美日韩在线看| 美女爽到高潮91| 91精品国产乱码| 亚洲va中文字幕| 欧美电影一区二区| 日韩精品亚洲一区| 欧美精品久久99久久在免费线| 亚洲地区一二三色| 欧美日韩电影在线| 爽好久久久欧美精品| 91精品在线免费| 蜜臂av日日欢夜夜爽一区| 日韩一二在线观看| 韩国精品在线观看| 久久久久久免费网| 国产成人丝袜美腿| 18涩涩午夜精品.www| 91免费视频观看| 亚洲一级片在线观看| 欧美日本乱大交xxxxx| 午夜成人在线视频| 欧美成人女星排行榜| 国产一区二区精品久久| 欧美激情自拍偷拍| 色婷婷久久久久swag精品| 亚洲成人免费在线| 日韩女优制服丝袜电影| 精品一区二区三区久久久| 欧美精品一区二| 99精品视频在线观看| 亚洲电影第三页| 欧美mv和日韩mv国产网站| 国产精品一区二区黑丝| 亚洲欧洲日本在线| 欧美日韩国产高清一区二区三区 | 国产精品午夜在线| 色婷婷激情综合| 奇米色一区二区三区四区| 久久精品在线观看| 99精品久久99久久久久| 午夜国产精品一区| 久久综合av免费| 色综合久久久久| 精品一区二区在线播放| 国产精品视频第一区| 欧美三级日本三级少妇99|