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

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

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜三级一区二区三| 综合电影一区二区三区 | 本田岬高潮一区二区三区| 色综合久久久久久久| 欧美日韩一区二区在线视频| 丁香六月综合激情| 欧美一区二区视频在线观看| 亚洲欧美一区二区久久| 99视频一区二区| 亚洲图片你懂的| 日本乱码高清不卡字幕| 亚洲美女视频在线| 91精品1区2区| 国产精品毛片大码女人| 91香蕉视频mp4| 亚洲综合在线免费观看| 精品视频一区 二区 三区| 日韩激情一二三区| 日韩美女在线视频| 成人av先锋影音| 日韩精品高清不卡| 亚洲欧美色一区| 日本高清不卡一区| 久久se精品一区精品二区| 欧美激情一区二区三区在线| 色噜噜狠狠色综合欧洲selulu| 视频一区欧美精品| 国产偷国产偷亚洲高清人白洁| 欧美午夜不卡在线观看免费| 加勒比av一区二区| 亚洲电影你懂得| 亚洲欧美一区二区三区国产精品| 日韩一区国产二区欧美三区| 91国产福利在线| 粉嫩嫩av羞羞动漫久久久| 日本不卡一区二区三区高清视频| 国产精品视频麻豆| 久久久久久久久蜜桃| 99精品一区二区三区| 大白屁股一区二区视频| 另类调教123区| 午夜精品123| 午夜视频在线观看一区| 亚洲精品欧美激情| 中文字幕日韩精品一区 | 精品欧美一区二区久久| 精品写真视频在线观看| 九一九一国产精品| 久久电影网电视剧免费观看| 亚洲超碰精品一区二区| 亚洲视频在线一区观看| 最新久久zyz资源站| 自拍偷拍亚洲激情| 日日骚欧美日韩| 国模套图日韩精品一区二区| 国产成a人亚洲精| 91麻豆国产福利精品| 欧美视频中文字幕| 日韩欧美一二三| 亚洲欧美日韩一区| 日韩精品欧美精品| 国产成人免费视频网站| 欧美在线小视频| 国产欧美一区视频| 亚洲一区二区三区在线| 午夜精品成人在线| 国内精品久久久久影院薰衣草| www.成人网.com| 久久久久久久久久电影| 一区二区三区在线免费播放| 九色|91porny| 精品视频一区 二区 三区| 久久久国产午夜精品| 曰韩精品一区二区| 不卡av免费在线观看| 日韩欧美在线1卡| 免费欧美日韩国产三级电影| aaa亚洲精品一二三区| 国产欧美日韩激情| 黄色小说综合网站| 日韩欧美中文字幕公布| 午夜天堂影视香蕉久久| 成人手机在线视频| 久久久亚洲精品一区二区三区| 天堂久久久久va久久久久| 欧美私人免费视频| 亚洲妇女屁股眼交7| 日本久久电影网| 国产欧美日韩在线| 国产a级毛片一区| 欧美日韩在线观看一区二区| 日韩欧美中文一区二区| 亚洲国产精品视频| 欧美一区二区在线视频| 日韩专区一卡二卡| 亚洲精品一区二区三区蜜桃下载 | 久久先锋资源网| 日本不卡视频一二三区| 日韩免费视频线观看| 国产69精品久久99不卡| 怡红院av一区二区三区| 777奇米成人网| 丁香五精品蜜臀久久久久99网站| 中文字幕在线播放不卡一区| 色综合天天综合网国产成人综合天 | 欧美巨大另类极品videosbest| 亚洲成人av电影| 久久久久久日产精品| 91玉足脚交白嫩脚丫在线播放| 一区二区三区四区国产精品| 日韩女优毛片在线| 91丝袜美腿高跟国产极品老师| 免费高清视频精品| 亚洲欧洲精品一区二区精品久久久| 欧美性感一区二区三区| 99久久综合精品| 国产一区二区精品在线观看| 亚洲国产一区视频| 一区二区在线观看免费视频播放| 日韩欧美美女一区二区三区| 在线视频你懂得一区| 国产精品亚洲一区二区三区在线| 亚洲国产一区二区三区| 一区二区三区日韩精品视频| 国产欧美视频一区二区| 久久精品亚洲精品国产欧美kt∨| 不卡的av电影在线观看| 丰满亚洲少妇av| 国产精品夜夜嗨| 成人涩涩免费视频| 国产91在线观看丝袜| 国产成人精品免费在线| 国产精品一区免费视频| 国产精品99久久久久久久女警| 久久不见久久见中文字幕免费| 久久国产人妖系列| 欧美一卡二卡三卡| 亚洲国产日韩精品| 国产精品人妖ts系列视频| 久久这里只精品最新地址| 日韩女优视频免费观看| 久久久久久久久蜜桃| 国产精品久久免费看| 一区二区在线电影| 午夜精品一区二区三区三上悠亚 | 狠狠色丁香九九婷婷综合五月| 久久精品国产第一区二区三区| 国产精品一色哟哟哟| 99久久久久久| 91麻豆精品国产| 国产精品视频九色porn| 丝袜美腿亚洲色图| 国产精品66部| 欧美肥妇bbw| 国产精品高潮呻吟久久| 丝袜美腿亚洲一区| eeuss鲁一区二区三区| 678五月天丁香亚洲综合网| 国产日韩成人精品| 天天操天天综合网| 99热这里都是精品| 欧美mv日韩mv亚洲| 亚洲精品一二三四区| 久久99精品视频| 欧美日韩中文字幕一区二区| 国产欧美一区二区精品性色| 日韩和的一区二区| 91丨porny丨国产入口| 日韩免费观看2025年上映的电影| 亚洲免费视频中文字幕| 国产福利一区二区三区视频| 欧美一区二区人人喊爽| 亚洲精品乱码久久久久久久久 | 麻豆精品视频在线观看| 99精品欧美一区二区三区小说| 精品第一国产综合精品aⅴ| 一区二区三区免费在线观看| 国产精品99久久久久久久vr| 日韩欧美精品在线视频| 又紧又大又爽精品一区二区| 成人国产精品免费观看动漫 | 17c精品麻豆一区二区免费| 久久99久久99小草精品免视看| 欧美日韩一区不卡| 亚洲免费在线电影| 99精品国产99久久久久久白柏| 久久精品一区二区三区不卡牛牛| 麻豆免费精品视频| 欧美一区二区黄色| 图片区小说区区亚洲影院| 欧美色大人视频| 亚洲h动漫在线| 欧美综合久久久| 伊人一区二区三区| 色狠狠综合天天综合综合| 亚洲色图欧洲色图| 91色在线porny| 一区二区三区在线观看视频| 色婷婷综合五月| 夜夜精品视频一区二区|