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

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

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
大尺度一区二区| 久久伊人蜜桃av一区二区| 欧美一卡二卡在线| 亚洲欧美怡红院| 激情成人综合网| 91精品麻豆日日躁夜夜躁| 亚洲天堂久久久久久久| 国产精品中文字幕日韩精品| 欧美麻豆精品久久久久久| 亚洲免费观看高清| aaa国产一区| 国产精品日韩成人| 懂色av一区二区三区免费看| 日韩精品一区二区三区在线播放 | 欧美性受极品xxxx喷水| 欧美国产综合色视频| 国产一区二区三区免费观看| 91麻豆精品久久久久蜜臀 | 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产成人精品1024| 26uuu亚洲综合色欧美 | 日韩精品午夜视频| 欧美日韩一区不卡| 午夜久久久久久| 欧美色图12p| 亚洲一区二区三区视频在线播放| 91麻豆福利精品推荐| 亚洲日穴在线视频| 一本色道亚洲精品aⅴ| 亚洲欧洲综合另类| 欧美手机在线视频| 亚洲成精国产精品女| 欧美蜜桃一区二区三区| 亚洲成在线观看| 欧美肥大bbwbbw高潮| 三级成人在线视频| 精品少妇一区二区三区视频免付费| 日本不卡的三区四区五区| 欧美一区二区三区视频在线观看| 日韩高清不卡一区二区三区| 日韩一区二区在线观看| 韩国视频一区二区| 欧美极品xxx| 色婷婷av一区二区三区软件| 亚洲图片欧美综合| 91精品国产综合久久精品app | 久久久久久久久久久99999| 国产一区二区久久| 国产精品天美传媒沈樵| 91麻豆精东视频| 日本一区中文字幕 | 成人久久视频在线观看| 亚洲视频一区二区在线| 欧美日韩高清一区二区三区| 久久精品999| 国产精品久久久久久久午夜片| 在线这里只有精品| 久久精品国产99| 亚洲三级理论片| 日韩午夜在线影院| 99免费精品视频| 日本午夜一区二区| 国产精品国产三级国产专播品爱网| 欧美亚洲另类激情小说| 九九久久精品视频| 国产精品二三区| 欧美一区二区三区男人的天堂| 国产福利一区在线观看| 亚洲一区二区三区四区的| 久久人人爽人人爽| 欧美亚洲高清一区| 成人性生交大片免费看中文| 亚洲高清一区二区三区| 国产视频视频一区| 欧美色窝79yyyycom| 国产suv精品一区二区三区| 亚洲一区二区精品视频| 国产日产亚洲精品系列| 欧美三区在线视频| 99热这里都是精品| 国产一区二区精品在线观看| 五月婷婷综合在线| 最新日韩在线视频| 国产亚洲美州欧州综合国| 在线不卡一区二区| 成人av电影免费观看| 久久国产麻豆精品| 爽好久久久欧美精品| 亚洲日本一区二区| 国产精品丝袜久久久久久app| 日韩一级欧美一级| 欧美在线观看视频在线| 国产激情91久久精品导航| 美女视频网站久久| 五月天亚洲婷婷| 亚洲国产精品麻豆| 18成人在线观看| 国产精品嫩草影院com| 久久精品视频一区| 欧美tickle裸体挠脚心vk| 欧美久久久久久蜜桃| 欧美性猛交xxxxxxxx| 97久久久精品综合88久久| 成人免费看的视频| 成人综合婷婷国产精品久久| 国产综合久久久久久鬼色| 久久电影网站中文字幕 | 久久久亚洲国产美女国产盗摄 | 国产精品成人网| 欧美国产一区在线| 中文字幕av不卡| 国产亚洲精久久久久久| 国产午夜亚洲精品午夜鲁丝片| 欧美成人精品福利| 亚洲精品一区二区三区蜜桃下载| 欧美xxxxx牲另类人与| 欧美mv日韩mv国产网站app| 欧美r级在线观看| 久久久精品影视| 中文字幕欧美激情| 国产精品不卡视频| 亚洲另类中文字| 亚洲国产精品久久不卡毛片| 亚洲国产一区二区在线播放| 亚洲成人福利片| 日本中文字幕一区二区视频 | 热久久一区二区| 激情亚洲综合在线| 成人一区二区三区在线观看| av在线不卡免费看| 欧美日韩一区不卡| 精品免费国产一区二区三区四区| www国产精品av| 中文字幕制服丝袜一区二区三区 | 欧美影院一区二区三区| 欧美精品一二三四| 久久久久久久性| 日韩理论片一区二区| 香蕉成人伊视频在线观看| 国产综合成人久久大片91| 91在线视频播放地址| 欧美久久久久中文字幕| 久久久精品中文字幕麻豆发布| 中文字幕在线不卡一区二区三区| 亚洲影视在线播放| 久草在线在线精品观看| 成人激情免费网站| 欧美午夜一区二区三区免费大片| 日韩精品一区二区三区swag| 国产精品国产a级| 青青草国产精品97视觉盛宴| 国产91精品在线观看| 欧美三级在线视频| 久久久精品国产99久久精品芒果 | 国产视频一区二区三区在线观看| 一区二区三区在线视频免费| 老司机精品视频导航| 色综合久久久久久久久久久| 日韩精品一区二区三区在线 | 欧美另类一区二区三区| 国产视频一区不卡| 日本aⅴ亚洲精品中文乱码| 99久久er热在这里只有精品66| 欧美一区二区三区在线看| 亚洲精品免费电影| 国产高清久久久久| 欧美一区二区三区婷婷月色 | 自拍av一区二区三区| 美美哒免费高清在线观看视频一区二区 | 中文字幕日韩精品一区| 老司机精品视频在线| 欧美色图12p| 亚洲视频狠狠干| 国产成人精品免费在线| 日韩欧美一级片| 午夜一区二区三区视频| 色老汉av一区二区三区| 亚洲国产精品成人久久综合一区| 麻豆成人久久精品二区三区小说| 在线精品观看国产| 中文字幕一区二区三区av| 久草热8精品视频在线观看| 91麻豆精品国产综合久久久久久| 亚洲精品欧美专区| av在线综合网| 国产精品成人网| 不卡视频免费播放| 国产三级一区二区三区| 久久99国产精品尤物| 欧美成人三级电影在线| 久久99精品久久久| 日韩一区二区三区四区五区六区| 亚洲国产精品精华液网站| 在线免费观看不卡av| 亚洲综合无码一区二区| 欧美午夜在线观看| 丝袜亚洲精品中文字幕一区| 欧美一区中文字幕| 九九视频精品免费| 久久久久97国产精华液好用吗|