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

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

?? sprite.java

?? 此文件是關(guān)于手機游戲開發(fā)的理論
?? 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一区二区三区免费野_久草精品视频
国产精品羞羞答答xxdd| 亚洲精品免费在线播放| 国产精品久久久久影院色老大| 中文字幕一区二区三区蜜月| 亚洲国产成人tv| 久久激情五月婷婷| 国产激情91久久精品导航| 91视频观看视频| 538在线一区二区精品国产| 26uuu另类欧美亚洲曰本| 亚洲欧美中日韩| 午夜激情一区二区| 日韩一区国产二区欧美三区| 久久精品男人天堂av| 夜夜嗨av一区二区三区网页| 麻豆久久久久久久| 99re热这里只有精品视频| 日韩欧美国产一区在线观看| 日韩毛片精品高清免费| 美女mm1313爽爽久久久蜜臀| www.欧美精品一二区| 日韩一级高清毛片| 亚洲人成网站色在线观看| 麻豆成人综合网| 在线日韩av片| 国产欧美va欧美不卡在线| 日日夜夜免费精品视频| 成人精品在线视频观看| 日韩精品一区二区三区三区免费| 亚洲人成网站在线| 国产精品一区免费在线观看| 欧美美女视频在线观看| 国产精品国产三级国产aⅴ原创 | 91麻豆蜜桃一区二区三区| 91精品国产综合久久国产大片 | 色综合视频在线观看| 日韩精品自拍偷拍| 亚洲一区二区美女| 粉嫩av一区二区三区| 欧美成人三级在线| 亚洲第一激情av| 91啦中文在线观看| 国产欧美日韩在线视频| 蜜桃av一区二区| 欧美日韩一区二区三区在线| 亚洲欧美综合在线精品| 成人深夜福利app| 久久先锋影音av鲁色资源 | 久久综合色天天久久综合图片| 亚洲综合区在线| 91色综合久久久久婷婷| 国产色综合一区| 国产精品原创巨作av| 欧美tickle裸体挠脚心vk| 日韩电影免费在线看| 欧美午夜精品免费| 亚洲美腿欧美偷拍| 成人黄页毛片网站| 久久女同精品一区二区| 国产一区二区三区久久久| 欧美变态凌虐bdsm| 久久成人免费日本黄色| 欧美一区二区三区免费大片 | 日韩欧美一二三四区| 无吗不卡中文字幕| 欧美日韩国产小视频在线观看| 一区二区三区四区不卡在线| 国产精品美女久久久久久| 国产乱子伦一区二区三区国色天香| 日韩视频在线永久播放| 免费观看在线综合| 欧美不卡一区二区三区四区| 麻豆国产精品官网| 26uuu精品一区二区| 国精产品一区一区三区mba视频| 精品国产三级电影在线观看| 久久99精品久久久久久| 久久久久久久久99精品| 国产99久久久国产精品潘金| 国产精品卡一卡二| 91天堂素人约啪| 亚洲观看高清完整版在线观看| 欧美日韩你懂的| 青娱乐精品在线视频| 精品国产一区二区三区久久久蜜月 | 国产一区二区三区视频在线播放| 亚洲精品在线一区二区| 国产传媒日韩欧美成人| 中文欧美字幕免费| 色婷婷综合中文久久一本| 亚洲高清免费一级二级三级| 91麻豆精品国产91久久久资源速度| 日日欢夜夜爽一区| 精品国产91乱码一区二区三区| 国产精品一区专区| 亚洲欧美日本在线| 欧美剧情片在线观看| 九一九一国产精品| 国产精品色呦呦| 欧洲精品中文字幕| 麻豆成人在线观看| 国产精品网站在线播放| 91老师片黄在线观看| 日韩和欧美一区二区| 久久久亚洲综合| 在线观看一区不卡| 麻豆精品在线视频| 1024亚洲合集| 欧美一区二区三区不卡| 成人小视频免费在线观看| 亚洲一区二区高清| 欧美精品一区二区三区四区| hitomi一区二区三区精品| 亚洲成人自拍一区| 欧美国产欧美综合| 欧美精品久久久久久久多人混战| 狠狠色2019综合网| 一区二区在线观看不卡| 欧美电影免费观看高清完整版在线 | 日韩一区二区三区四区五区六区| 国产在线不卡一区| 一区二区在线观看av| 精品久久久久久久久久久院品网| 91在线porny国产在线看| 日韩av在线免费观看不卡| 国产精品婷婷午夜在线观看| 亚洲电影一级黄| xfplay精品久久| 欧美日韩一区不卡| 懂色av一区二区在线播放| 首页国产欧美久久| 亚洲色图欧美偷拍| 欧美精品一区二区在线观看| 在线一区二区观看| 成人性色生活片免费看爆迷你毛片| 婷婷开心久久网| 亚洲色图在线看| 久久久欧美精品sm网站| 欧美精品在线观看播放| 91亚洲国产成人精品一区二三 | 久久综合九色综合97_久久久| 色婷婷综合久久久中文一区二区 | 国产精品伦一区二区三级视频| 在线播放91灌醉迷j高跟美女| 99综合影院在线| 国产在线一区观看| 日韩不卡一二三区| 亚洲最新在线观看| 国产精品久久久久久久浪潮网站 | 成人激情动漫在线观看| 久久国产福利国产秒拍| 日一区二区三区| 亚洲一区视频在线观看视频| 国产精品丝袜一区| 久久理论电影网| 日韩欧美国产一区二区在线播放| 在线国产电影不卡| 91免费看片在线观看| 国产成人精品三级| 国产一区视频导航| 日本不卡一区二区三区| 亚洲国产乱码最新视频 | 884aa四虎影成人精品一区| 一本一道综合狠狠老| 成人免费看的视频| 国产成人综合精品三级| 国内精品免费在线观看| 久久se精品一区二区| 亚洲成人午夜电影| 亚洲一区日韩精品中文字幕| 亚洲人被黑人高潮完整版| 国产精品视频看| 中文字幕第一区综合| 国产欧美视频一区二区三区| 2014亚洲片线观看视频免费| 337p日本欧洲亚洲大胆精品 | 国产传媒日韩欧美成人| 国产一区二区成人久久免费影院| 久久er99热精品一区二区| 精品一区二区三区免费播放| 日韩二区三区四区| 日韩高清不卡一区二区三区| 日韩国产欧美三级| 美女视频免费一区| 久久99精品久久久久久国产越南 | 国产精品久久久久三级| 国产精品一区专区| 丁香另类激情小说| www.久久精品| 91久久香蕉国产日韩欧美9色| 91搞黄在线观看| 欧美日韩精品一二三区| 欧美一卡二卡在线| 精品国产91洋老外米糕| 国产肉丝袜一区二区| 国产精品人人做人人爽人人添| 国产精品传媒入口麻豆| 亚洲韩国精品一区| 毛片av一区二区| 国产成人在线看|