资源简介
java初学者,自己做了一个魔塔游戏,请各位高手指导。
我是菜鸟。含源码。
顺便赚点积分。
代码片段和文件信息
import java.applet.applet;
import java.applet.AudioClip;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
class Enemy {
String name;
int attack defense gold exp;
long life;
Image sprite[];
public Enemy(Image[] image){
attack = 0; defense = 0; gold = 0; exp = 0; life = 0;
this.sprite = new Image[2];
this.sprite = image;
}
public void setProperty(String name long life int attack int defense int gold int exp){
this.name = name; this.life = life; this.attack = attack;
this.defense = defense; this.gold = gold; this.exp = exp;
}
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
public int getAttack() {
return attack;
}
public void setAttack(int attack) {
this.attack = attack;
}
public int getDefense() {
return defense;
}
public void setDefense(int defense) {
this.defense = defense;
}
public int getExp() {
return exp;
}
public void setExp(int exp) {
this.exp = exp;
}
public int getGold() {
return gold;
}
public void setGold(int gold) {
this.gold = gold;
}
public long getLife() {
return life;
}
public void setLife(long life) {
this.life = life;
}
}
public class Mota extends applet implements Runnable KeyListener {
static int W = 32 ENEMY_KINDS = 33 PROP_KINDS = 33 AIDED_KIND = 8;
static int DOWN = 0 LEFT = 1 UP = 2 RIGHT = 3;
int list[] = new int[20]; int listUsefulLength = 0; int totle;
int appletWidth appletHeight location_x location_y levels attack defense gold exp floor;
int bluekey yellowkey redkey roleDirection;
long life;
//各种情节的Flag,有点多了,之前没有规划好......
boolean shakeFlag = false isGameOver = false isCanViewBook = false isGameGoing = true;
boolean isWait = false isViewingBook = false isShowSpeaking = false isShowShop = false;
boolean isSuperShop = false isSuperExpShop = false isShowExpShop = false isShowKeyShop = false isShowKeySellShop = false;
boolean isCanFly = false isHaveHammer = false princessOnce = true princessTwice = false princessThird = false;
boolean isBoss = false isSpeakToBossFirst = true isSpeakToBossSecond = false isSpeakToBossThird = false isSpeakToBossFouth = false;
boolean isBossDead = false isSpeakToJackFirst = true isSpeakToJackSecond = false;
boolean isSpeakToSpriteFirst = true isSpeakToSpriteSecond = false isSpeakToSpriteThird = false isHaveCrossing = false;
boolean isProp = false;
boolean isGameStart = false theGameIsReallyOver = false;
int choose = 1; int addy = 0;
String string;
Thread newThread;
JPanel state;
Enemy enemy[];
Image offScreen sprite[][] prop[] roleSprite[] aidedSprite[][];
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 46963 2010-03-14 18:25 Mota.class
文件 60344 2010-03-14 18:25 Mota.java
文件 131 2010-03-05 23:46 test.html
文件 41222 2002-09-25 16:30 audio\mota\choosing.wav
文件 15654 2002-09-26 15:49 audio\mota\fight.wav
文件 9870 2000-02-01 04:40 audio\mota\moving.wav
文件 7340722 2010-03-05 21:03 audio\mota\start.wav
文件 379766 2002-09-26 15:57 audio\mota\win.wav
文件 2120 2010-02-28 21:55 image\mota\10_1.jpg
文件 2045 2010-02-28 21:55 image\mota\10_2.jpg
文件 2188 2010-02-28 21:53 image\mota\11_1.jpg
文件 2184 2010-02-28 21:54 image\mota\11_2.jpg
文件 2381 2010-02-28 22:01 image\mota\12_1.jpg
文件 2369 2010-02-28 22:02 image\mota\12_2.jpg
文件 2097 2010-03-01 22:44 image\mota\13_1.jpg
文件 2107 2010-03-01 22:45 image\mota\13_2.jpg
文件 2019 2010-02-28 22:33 image\mota\14_1.jpg
文件 2039 2010-02-28 22:33 image\mota\14_2.jpg
文件 2185 2010-02-28 21:52 image\mota\15_1.jpg
文件 2221 2010-02-28 21:52 image\mota\15_2.jpg
文件 2340 2010-02-28 22:06 image\mota\16_1.jpg
文件 2319 2010-02-28 22:07 image\mota\16_2.jpg
文件 2112 2010-03-01 22:46 image\mota\17_1.jpg
文件 2118 2010-03-01 23:02 image\mota\17_2.jpg
文件 2166 2010-02-28 22:34 image\mota\18_1.jpg
文件 2155 2010-02-28 22:34 image\mota\18_2.jpg
文件 2157 2010-02-28 22:02 image\mota\19_1.jpg
文件 2100 2010-02-28 22:02 image\mota\19_2.jpg
文件 2063 2010-02-28 18:51 image\mota\1_1.jpg
文件 2128 2010-02-28 18:52 image\mota\1_2.jpg
............此处省略107个文件信息
评论
共有 条评论