亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成人动漫视频在线| 亚洲狼人国产精品| 国产精品不卡视频| 亚洲一区在线视频| 日韩精品一二三区| 国产很黄免费观看久久| 一道本成人在线| 制服丝袜一区二区三区| 国产日韩欧美综合在线| 亚洲永久免费视频| 玖玖九九国产精品| 97精品超碰一区二区三区| 欧美狂野另类xxxxoooo| 久久久久久久久97黄色工厂| 亚洲日本在线看| 美女精品一区二区| 99久久er热在这里只有精品66| 欧美日韩dvd在线观看| 国产婷婷精品av在线| 香港成人在线视频| 成人免费观看视频| 日韩一区二区在线看片| 综合自拍亚洲综合图不卡区| 日韩av电影免费观看高清完整版在线观看 | 日本网站在线观看一区二区三区 | 中文字幕在线不卡一区| 天天色 色综合| 成人小视频免费观看| 91精品国产91久久久久久最新毛片 | 日韩一区二区三区在线观看| 中文字幕一区二区三区在线播放| 三级在线观看一区二区| 99久久精品国产麻豆演员表| 91精品国产乱码| 亚洲乱码国产乱码精品精的特点 | 国产日韩v精品一区二区| 亚洲午夜精品在线| 97久久久精品综合88久久| 26uuu成人网一区二区三区| 五月天亚洲精品| 一本色道久久综合精品竹菊| 久久精品亚洲麻豆av一区二区| 丝袜亚洲另类欧美| 91久久国产最好的精华液| 日本一区二区三区在线观看| 日本不卡免费在线视频| 欧美日韩五月天| 亚洲美女精品一区| av亚洲精华国产精华精| 2023国产精品自拍| 秋霞电影一区二区| 欧美性感一区二区三区| 亚洲男人电影天堂| 9人人澡人人爽人人精品| 国产日韩欧美不卡| 国产麻豆91精品| 2017欧美狠狠色| 久久99精品国产麻豆婷婷洗澡| 日韩成人免费看| 欧美亚洲日本国产| 亚洲精品视频免费看| www.成人网.com| 欧美国产1区2区| 成人免费三级在线| 日本一区二区三区高清不卡| 国产一区啦啦啦在线观看| 日韩精品一区二区三区四区视频| 青草国产精品久久久久久| 91精品国产综合久久国产大片| 亚洲成人av资源| 欧美美女一区二区在线观看| 香港成人在线视频| 91精品国产美女浴室洗澡无遮挡| 日本免费新一区视频| 欧美高清激情brazzers| 香蕉影视欧美成人| 91精品久久久久久久99蜜桃| 免费久久99精品国产| 日韩欧美精品在线| 韩国av一区二区三区四区| 久久久高清一区二区三区| 国产传媒久久文化传媒| 中文无字幕一区二区三区| 成人动漫在线一区| 亚洲精品高清在线| 欧美色综合影院| 日韩精品一二三区| www激情久久| 成人av免费观看| 亚洲精品乱码久久久久久黑人 | 日韩精品一级二级| 日韩欧美中文字幕精品| 国产米奇在线777精品观看| 国产精品视频一区二区三区不卡| 99在线精品观看| 亚洲一区视频在线| 91精品中文字幕一区二区三区| 久久99精品久久久| 日本一区二区高清| 在线一区二区三区| 日韩精品亚洲一区| 久久综合给合久久狠狠狠97色69| 成人sese在线| 亚洲国产婷婷综合在线精品| 欧美一区二区三区四区高清 | 国产精品美女一区二区在线观看| 色综合久久久久久久久久久| 偷拍一区二区三区| 欧美大尺度电影在线| 成人免费高清在线观看| 亚洲成人第一页| 久久精品夜夜夜夜久久| 在线一区二区三区四区五区| 久久草av在线| 中文字幕一区二区三区不卡在线| 欧美日韩一区二区三区四区五区| 麻豆精品新av中文字幕| 国产精品久久久久久久第一福利| 欧美美女视频在线观看| 从欧美一区二区三区| 无码av中文一区二区三区桃花岛| 精品电影一区二区| 91福利在线观看| 国产一区二区三区免费看| 亚洲美女视频在线观看| 久久综合久久久久88| 在线视频观看一区| 国产一区二区中文字幕| 亚洲综合视频在线| 国产日韩欧美亚洲| 91精品国产福利在线观看| 91在线观看污| 激情五月婷婷综合| 亚洲一区二区欧美| 国产日韩影视精品| 日韩一区二区不卡| 91国产丝袜在线播放| 国产一区二区三区不卡在线观看 | 日韩欧美一区电影| 色视频欧美一区二区三区| 国内精品第一页| 日韩精品免费视频人成| 亚洲日穴在线视频| 国产欧美日韩视频在线观看| 777a∨成人精品桃花网| 91丨porny丨最新| 国产精华液一区二区三区| 日韩精品电影在线观看| 亚洲免费伊人电影| 欧美国产日产图区| 日韩限制级电影在线观看| 91九色最新地址| av不卡在线观看| 国产精品香蕉一区二区三区| 蜜桃视频第一区免费观看| 午夜国产精品影院在线观看| 亚洲三级电影全部在线观看高清| 国产欧美日韩麻豆91| 久久综合色综合88| 日韩一区二区免费在线电影 | 久久国产尿小便嘘嘘尿| 亚洲国产精品视频| 亚洲女人的天堂| 亚洲欧洲日韩综合一区二区| 久久久欧美精品sm网站| 精品国产在天天线2019| 日韩一区二区在线观看视频 | 国产呦萝稀缺另类资源| 日本特黄久久久高潮| 日韩国产精品久久久久久亚洲| 亚洲成人777| 亚洲午夜电影网| 一区二区三区不卡视频| 亚洲女人小视频在线观看| 国产精品久久久久久久久动漫 | 欧美在线一二三| 色94色欧美sute亚洲13| 色哟哟精品一区| 91美女蜜桃在线| 色狠狠一区二区| 欧美视频一区二区三区在线观看| 91精彩视频在线| 欧美色视频一区| 欧美日韩国产电影| 91精品国产91久久久久久最新毛片| 91精品国产日韩91久久久久久| 91精品国产一区二区三区| 日韩欧美激情在线| 久久综合九色综合97婷婷女人| 久久久国际精品| 国产精品久久久久久户外露出| 亚洲人午夜精品天堂一二香蕉| 亚洲色图一区二区| 亚洲一区二区欧美激情| 三级亚洲高清视频| 乱一区二区av| 国产成人一级电影| 99久久免费精品高清特色大片| 在线视频欧美精品| 91精品国产一区二区三区蜜臀|