亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美喷潮久久久xxxxx| 在线一区二区三区四区五区| 日韩欧美色电影| 日本午夜精品视频在线观看| 日韩精品在线看片z| 久久99久久久久| 久久久久久久久久电影| 成人动漫中文字幕| 一级特黄大欧美久久久| 欧美日本一区二区三区四区| 日本不卡一区二区三区| 久久久99免费| 99热国产精品| 亚洲宅男天堂在线观看无病毒| 欧美性感一类影片在线播放| 琪琪一区二区三区| 国产日韩欧美电影| 日本精品视频一区二区三区| 日韩电影在线免费观看| 久久久久99精品国产片| 91无套直看片红桃| 青青草一区二区三区| 国产色产综合产在线视频| 色美美综合视频| 秋霞国产午夜精品免费视频| 国产欧美一区视频| 在线观看日韩精品| 国产主播一区二区三区| 亚洲天堂免费看| 91精品国产色综合久久不卡电影| 国产成人午夜99999| 一区二区三区色| 久久久亚洲欧洲日产国码αv| 91在线视频18| 久久疯狂做爰流白浆xx| 亚洲免费观看视频| ww久久中文字幕| 欧美日韩精品一区二区天天拍小说 | 日本怡春院一区二区| 国产日韩欧美综合一区| 欧美天堂亚洲电影院在线播放| 激情久久五月天| 亚洲第一福利一区| 国产精品二区一区二区aⅴ污介绍| 欧美视频完全免费看| 粉嫩欧美一区二区三区高清影视 | 日本在线不卡一区| 亚洲欧美日韩小说| 国产丝袜在线精品| 精品国精品自拍自在线| 欧美性xxxxx极品少妇| 不卡av在线网| 国产乱码精品一区二区三区忘忧草 | 亚洲成人午夜影院| 亚洲欧美色综合| 久久久青草青青国产亚洲免观| 欧美日韩国产高清一区| 91免费精品国自产拍在线不卡| 国产精品18久久久久久久久久久久 | 亚洲三级理论片| 国产色91在线| 久久综合狠狠综合久久激情| 欧美精品自拍偷拍动漫精品| 一本一道久久a久久精品 | 精品国产a毛片| 欧美一区二区人人喊爽| 欧美日韩午夜影院| 欧美日韩一级二级三级| 欧美视频精品在线观看| 色综合色综合色综合色综合色综合 | 色激情天天射综合网| 成人性视频网站| 国产91精品久久久久久久网曝门| 久久66热偷产精品| 国产在线精品一区二区三区不卡| 美女网站色91| 久久99日本精品| 精品一区二区三区在线播放| 蜜臀精品一区二区三区在线观看| 毛片基地黄久久久久久天堂| 蜜臀精品久久久久久蜜臀| 美女网站色91| 国产一区二区三区香蕉| 国产九色sp调教91| 成人国产视频在线观看| 不卡一区二区在线| 色婷婷亚洲综合| 欧美日韩国产在线观看| 欧美一区二区女人| 久久欧美一区二区| 国产精品精品国产色婷婷| 亚洲欧洲无码一区二区三区| 亚洲精品美腿丝袜| 午夜精品一区二区三区免费视频 | 国产精品污污网站在线观看 | 最新国产精品久久精品| 最近中文字幕一区二区三区| 亚洲女同一区二区| 视频在线观看一区| 日本va欧美va精品| 国产+成+人+亚洲欧洲自线| 欧美一级在线观看| www国产精品av| 精品久久久影院| 亚洲精品在线三区| 日韩美女久久久| 日韩不卡免费视频| 成人午夜av在线| 欧美偷拍一区二区| 日韩精品一区二区三区在线观看 | 波多野结衣中文字幕一区二区三区| 99亚偷拍自图区亚洲| 欧美性videosxxxxx| 精品欧美久久久| 亚洲精品中文字幕在线观看| 天堂成人免费av电影一区| 国产一区亚洲一区| 日本丶国产丶欧美色综合| 精品国产乱码久久| 伊人婷婷欧美激情| 韩国理伦片一区二区三区在线播放| 波多野结衣91| 欧美不卡激情三级在线观看| 亚洲精品免费电影| 国产成人午夜精品影院观看视频| 在线视频国产一区| 久久日韩精品一区二区五区| 一区二区三区四区精品在线视频| 激情综合色播激情啊| 欧美性色黄大片| 中文字幕乱码一区二区免费| 婷婷丁香久久五月婷婷| eeuss鲁一区二区三区| 日韩精品一区二区三区视频在线观看| 亚洲色图欧洲色图婷婷| 国产在线观看免费一区| 在线播放中文字幕一区| 自拍偷拍国产精品| 国产一区91精品张津瑜| 在线不卡中文字幕| 亚洲午夜精品17c| 99精品国产热久久91蜜凸| 久久精品亚洲精品国产欧美kt∨ | 国产成a人亚洲精| 日韩欧美自拍偷拍| 亚洲一区二区三区四区的| 成人av免费在线观看| 久久亚区不卡日本| 麻豆精品在线看| 欧美一级日韩免费不卡| 亚洲第一福利视频在线| 色吊一区二区三区 | 一区二区三区精品视频在线| 国产成人av网站| 精品成人一区二区| 免费高清成人在线| 91精品欧美福利在线观看| 亚洲成人你懂的| 欧美日韩精品一区二区三区| 亚洲一区二区在线观看视频 | 日本亚洲最大的色成网站www| 色88888久久久久久影院按摩| 国产精品乱码久久久久久| 国产成人日日夜夜| 中文字幕乱码日本亚洲一区二区| 国产成人精品免费网站| 久久精品人人爽人人爽| 国产精品一区一区| 国产清纯美女被跳蛋高潮一区二区久久w| 麻豆国产精品官网| 欧美精品一区二区三区蜜桃视频| 伦理电影国产精品| 久久亚区不卡日本| 国产a精品视频| 国产精品美女一区二区三区| 成人精品免费网站| 亚洲色图丝袜美腿| 欧洲人成人精品| 免费在线欧美视频| 久久精品网站免费观看| 懂色av中文字幕一区二区三区| 国产精品丝袜一区| 色综合天天视频在线观看| 亚洲chinese男男1069| 欧美精品 国产精品| 久久国产精品99精品国产| 久久久久99精品国产片| 99九九99九九九视频精品| 玉米视频成人免费看| 欧美日韩成人一区| 精品一区二区在线播放| 国产精品嫩草影院av蜜臀| 91猫先生在线| 日韩av一区二区三区| 久久精品一区二区三区不卡| 日本国产一区二区| 日韩电影在线看| 国产精品视频第一区| 欧美亚洲综合久久| 奇米色一区二区三区四区|