资源简介
一个用java实现的简单地图编辑器,里面的贴图可以自由更换
代码片段和文件信息
import java.awt.Image;
import java.util.ArrayList;
/**
The Animation class manages a series of images (frames) and
the amount of time to display each frame.
*/
public class Animation {
private ArrayListame> frames;
private int currframeIndex;
private long animTime;
private long totalDuration;
/**
Creates a new empty Animation.
*/
public Animation() {
frames = new ArrayListame>();
totalDuration = 0;
start();
}
/**
Adds an image to the animation with the specified
duration (time to display the image).
*/
public synchronized void addframe(Image image
long duration)
{
totalDuration += duration;
frames.add(new Animframe(image totalDuration));
}
/**
Starts this animation over from the beginning.
*/
public synchronized void start() {
animTime = 0;
currframeIndex = 0;
}
/**
Updates this animation‘s current image (frame) if
necessary.
*/
public synchronized void update(long elapsedTime) {
if (frames.size() > 1) {
animTime += elapsedTime;
if (animTime >= totalDuration) {
animTime = animTime % totalDuration;
currframeIndex = 0;
}
while (animTime > getframe(currframeIndex).endTime) {
currframeIndex++;
}
}
}
/**
Gets this Animation‘s current image. Returns null if this
animation has no images.
*/
public synchronized Image getImage() {
if (frames.size() == 0) {
return null;
}
else {
return getframe(currframeIndex).image;
}
}
private Animframe getframe(int i) {
return (Animframe)frames.get(i);
}
private class Animframe {
Image image;
long endTime;
public Animframe(Image image long endTime) {
this.image = image;
this.endTime = endTime;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 301 2011-12-11 20:27 MapEditor\.classpath
文件 385 2011-12-11 20:27 MapEditor\.project
文件 629 2011-12-11 20:27 MapEditor\.settings\org.eclipse.jdt.core.prefs
文件 529 2011-12-23 19:32 MapEditor\bin\Animation$Animfr
文件 1567 2011-12-23 19:32 MapEditor\bin\Animation.class
文件 5396 2011-12-22 21:32 MapEditor\bin\Createfr
文件 1652 2011-12-19 21:41 MapEditor\bin\GameAction.class
文件 8017 2011-12-23 19:34 MapEditor\bin\InputManager.class
文件 8186 2011-12-23 20:22 MapEditor\bin\MapEditor.class
文件 7898 2011-12-23 20:12 MapEditor\bin\MapEditorfr
文件 560 2011-12-23 19:34 MapEditor\bin\Sprite$Route.class
文件 3592 2011-12-23 19:34 MapEditor\bin\Sprite.class
文件 505 2011-12-20 22:37 MapEditor\bin\TileAttribute.class
文件 3751 2011-12-23 19:35 MapEditor\bin\TileMap.class
文件 34443 2009-12-15 09:22 MapEditor\images\fight000_1-1.JPG
文件 777 2011-08-01 08:57 MapEditor\images\godown\103_40.png
文件 757 2011-08-01 08:57 MapEditor\images\godown\103_41.png
文件 749 2011-08-01 08:57 MapEditor\images\godown\103_42.png
文件 777 2011-08-01 08:57 MapEditor\images\godown\103_43.png
文件 752 2011-08-01 08:57 MapEditor\images\godown\103_44.png
文件 742 2011-08-01 08:57 MapEditor\images\godown\103_45.png
文件 740 2011-08-01 08:57 MapEditor\images\godown\103_46.png
文件 763 2011-08-01 08:57 MapEditor\images\godown\103_47.png
文件 807 2011-08-01 08:57 MapEditor\images\goleft\103_56.png
文件 769 2011-08-01 08:57 MapEditor\images\goleft\103_57.png
文件 768 2011-08-01 08:57 MapEditor\images\goleft\103_58.png
文件 780 2011-08-01 08:57 MapEditor\images\goleft\103_59.png
文件 782 2011-08-01 08:57 MapEditor\images\goleft\103_60.png
文件 821 2011-08-01 08:57 MapEditor\images\goleft\103_61.png
文件 784 2011-08-01 08:57 MapEditor\images\goleft\103_62.png
............此处省略66个文件信息
相关资源
- Java文档管理系统论文
- mysql-connector-java-5.1.6-bin.jar.zip
- 重庆理工大学软件工程、计算机学院
- myeclipse实现的Java课程设计.docx
- ATM模拟系统.zip
- 数据库课程设计-水费收费管理系统
- JAVAGUI+Mysq学生管理系统.zip
- 《奔跑吧!小恐龙》小游戏_源代码
- java+sql 库存管理系统
- Java架构师.txt
- Java银行管理系统62804
- 节约算法JAVA代码
- 在线考试系统jsp+servlet_jap+servlet考试
- Express12.zip
- SM 国密算法Java+JS
- Java飞翔的小鸟全部代码
- java.txt
- OpenCV_Java帮助文档3.0.CHM
- java GUI awt 实现鼠标绘制矩形,鼠标拖
- 郭java.txt
- 东华软件股笔试题2019java
- 用JAVA开发网络聊天室
- java简易连连看网络实时对战
- java课程设计-银行卡存取款管理系统
- Java语言程序设计与数据结构基础篇第
- 绩效考核系统
- Android移动终端开发大作业2019
- java期末大作业_五子棋小游戏单机版
- Java SSM框架三端在线教育平台
- 传智播客Javaweb视频课堂笔记源码全部
评论
共有 条评论