【java人物上下跳动代码 java下滑】 }
public MoveImageChange(int frequency,int count){
this.frequency=frequency;
this.count = count;
}
publicImage imageChange(Image[] images){
if(img==null){//初始图片为第一张图片
img=images[0];
}
count++;
if(countfrequency){//当记数器大于频率时
count=0;
loopCount++;
if(loopCount = images.length){//图片下标越界时
loopCount=0;
}
img=images[loopCount];
}
return img;
}
public void setLoopCount(int loopCount){
this.loopCount = loopCount;
}
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
package com.lovo.game.role;
import java.awt.Graphics;
import java.awt.Image;
import com.lovo.game.util.MoveImageChange;
public class ZhaoYun {
public static Image[] zyImage;
private int x =600;
private int y =300;
private int width =200;
private int height =130;
private MoveImageChange moveChange = new MoveImageChange(3);
public void drawImage(Graphics memoryGraphics){
Image img = moveChange.imageChange(zyImage);
memoryGraphics.drawImage(img,this.x,this.y,this.width,this.height,null);
关于java人物上下跳动代码和java下滑的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- linux中各命令的意义,linux各种命令
- zblog插件原理,zblog插件破解插件
- 软件刚开直播电视,打开直播电视
- go语言slice使用 go语言strconv
- 关于c语言设计车辆限行的信息
- 欧版p40pro可以升级鸿蒙吗,欧版p40pro在国内可以用5g吗
- 宝宝巴士游戏老鼠大冒险,宝宝巴士小老鼠乡下老鼠
- 关于vb.net视频百度云盘的信息
- 魔幻车神什么视频能看,魔幻车神的影视