// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
import com.nokia.mid.ui.*;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.microedition.lcdui.*;
class ZapperCanvas extends FullCanvas
{
int page;
private Command cmdExit;
private Command cmdClear;
protected int fireKey;
protected int leftKey;
protected int rightKey;
protected int upKey;
protected int downKey;
protected int oneKey;
int WIDTH;
int HEIGHT;
Image offscreen;
Image logo;
//************************
private int targetFPS=5;
private int introTimer=0;
Image logo1;
//*************************
Image arrow;
int ttt;
Road road;
int id;
int keyTemp;
ZASM midlet;
Hashtable Cars;
boolean showBump;
boolean accel;
int quadrant;
int lane;
int opponents;
int music;
int music1;
boolean changeLaneUp;
boolean changeLaneDn;
boolean gameStart;
boolean gameOver;
boolean timeOut;
boolean outoffuel;
boolean showSignals;
int signalCtr;
boolean paused;
timeKeeper time;
Image signal;
int joyStickctr;
int score[];
int level;
Image outoftime;
int speed;
Image inner;
//Image flagImg;
//Image indiagames;
Image zapperImg;
Image tcarimg;
int inx[];
int iny[];
int selRectPos;
int fuel;
int rank;
boolean loaded;
Image fuelImg;
public static boolean medialoaded = false;
public static int totalMedia = 20;
public static int loadedMedia = 0;
boolean hiScore;
int loadCtr;
int cpage;
public Image kbImg;
static GameDataManager gdm;
static String rname = new String();
int rscore;
static String rnames[];
int rscores[];
int MAX_TOP_SCORES;
int Score;
SoundPlayer gamesound;
static boolean sndEnable = true;
int about;
int hCtr;
public ZapperCanvas(ZASM zapper)
{
page = 0;
ttt = 0;
keyTemp = 0;
Cars = new Hashtable();
showBump = false;
accel = false;
quadrant = 0;
lane = 4;
music = 0;
music1 = 0;
changeLaneUp = false;
changeLaneDn = false;
gameStart = false;
gameOver = false;
timeOut = false;
outoffuel = false;
showSignals = true;
paused = false;
joyStickctr = 0;
score = new int[4];
level = 3;
speed = 0;
fuel = 100;
rank = 0;
loaded = false;
loadCtr = 0;
cpage = 1;
MAX_TOP_SCORES = 3;
about = 0;
midlet = zapper;
WIDTH = getWidth();
HEIGHT = getHeight();
fireKey = getKeyCode(8);
leftKey = getKeyCode(2);
rightKey = getKeyCode(5);
upKey = getKeyCode(1);
downKey = getKeyCode(6);
if(!isDoubleBuffered())
offscreen = Image.createImage(WIDTH, HEIGHT);
try
{
kbImg = Image.createImage("/keyboard.png");
logo = Image.createImage("/logo.png");
}
catch(Exception exception)
{
System.out.println("异常" + exception);
}
gamesound = new SoundPlayer(zapper);
road = new Road();
gdm = new GameDataManager(this);
rnames = new String[MAX_TOP_SCORES];
rscores = new int[MAX_TOP_SCORES];
for(int i = 0; i < MAX_TOP_SCORES; i++)
{
rnames[i] = new String("");
rscores[i] = 0;
}
gdm.SetupKeyBoard(kbImg);
gdm.object.getRecords();
try
{
fuelImg = Image.createImage("/fuel.png");
outoftime = Image.createImage("/outoftime.png");
loadedMedia = 1;
signal = Image.createImage("/signal.png");
loadedMedia = 2;
//indiagames = Image.createImage("/indiagames.png");
loadedMedia = 5;
//zapperImg = Image.createImage("/zapper.png");
loadedMedia = 6;
//inner = Image.createImage("/inside.png");
inner = Image.createImage("/title.png");
loadedMedia = 7;
//flagImg = Image.createImage("/flag2.png");
loadedMedia = 8;
arrow = Image.createImage("/arrow.png");
loadedMedia = 9;
logo = Image.createImage("/p1.png");//logo = Image.createImage("/logo.png");
loadedMedia = 10;
logo1 = Image.createImage("/p2.png");
loadedMedia = 11;
}
catch(Exception exception1)
{
System.out.println("图片不存在" + exception1);
}
initBG();
medialoaded = true;
}
public void initBG()
{
int i = 3 + 176 / inner.getWidth();
int j = 3 + 208 / inner.getHeight();
inx = new int[i];
iny = new int[j];
for(int k = 0; k < i; k++)
inx[k] = k * inner.getWidth();
for(int l = 0; l < j; l++)
iny[l] = l * inner.getHeight();
System.gc();
}
public void DrawBGS(Graphics g)
{
//int i = WIDTH / inner.getWidth() + 3;
//int j = HEIGHT / inner.getHeight() + 3;
//for(int k = 0; k < i; k++)
//{
//for(int l = 0; l < j; l++)
//g.drawImage(inner, inx[k], iny[l], 0x10 | 0x4);
g.drawImage(inner, 0, 0, 0x10 | 0x4);
//}
//if(inx[0] > -1 * inner.getWidth())
// {
//for(int i1 = 0; i1 < i; i1++)
//inx[i1] -= 6;
// for(int j1 = 0; j1 < j; j1++)
//iny[j1] -= 8;
//}
//else
//{
// initBG();
// }
if(page == 1)
{
DirectGraphics directgraphics = DirectUtils.getDirectGraphics(g);
//g.drawImage(flagImg, 10, 15, 0x10 | 0x4);
//directgraphics.drawImage(flagImg, 90, 15, 0x10 | 0x4, 8192);
//g.setColor(255, 255, 255);
//g.drawImage(indiagames, WIDTH / 2 - indiagames.getWidth() / 2, (HEIGHT / 2 - indiagames.getHeight()) + 10, 0x10 | 0x4);
//g.drawImage(zapperImg, WIDTH / 2 - zapperImg.getWidth() / 2, 5, 0x10 | 0x4);
byte byte0 = 30;
g.setColor(255, 255, 255);
g.setFont(Font.getFont(0, 1, 8));
if(joyStickctr % 2 == 0)
{
g.drawString("按5键开始比赛", 50, 185, 20);
joyStickctr = 0;
}
joyStickctr++;
} else
{
// g.drawImage(zapperImg, WIDTH / 2 - zapperImg.getWidth() / 2, 5, 0x10 | 0x4);
}
}
public void paint(Graphics g)
{
Graphics g1 = g;
if(offscreen != null)
g = offscreen.getGraphics();
if(page == 1 && sndEnable)
gamesound.playBg();
if(page == 9 && sndEnable && music1 < 2)
{
gamesound.stopSounds();
gamesound.playHall();
music1++;
}
if(page == 0)
{
//g.setColor(0, 0, 0);
//g.fillRect(0, 0, 176, 208);
//g.setColor(255, 0, 0);
//g.setColor(255, 255, 255);
//g.fillRect(28, 170, 120, 10);
//g.setColor(255, 0, 0);
//g.fillRect(28, 170, (120 / totalMedia) * loadCtr, 10);
//g.drawImage(logo, 0, 0, 0x4 | 0x10);//g.drawImage(logo, 32, 60, 0x4 | 0x10);
//g.setColor(252, 255, 0);
//g.drawRect(28, 170, 120, 10);
没有合适的资源?快使用搜索试试~ 我知道了~
Java机车狂飙源代码.zip
共88个文件
png:45个
class:18个
java:8个
需积分: 0 0 下载量 62 浏览量
2022-08-28
11:29:51
上传
评论
收藏 474KB ZIP 举报
温馨提示
Java机车狂飙源代码.zip
资源推荐
资源详情
资源评论
收起资源包目录
Java机车狂飙源代码.zip (88个子文件)
codefans.net
JCKB_S60
截图
2.BMP 143KB
title.png 11KB
1.BMP 140KB
classes
SoundPlayer.class 2KB
ZapperTimer.class 807B
Road.class 3KB
Car.class 6KB
GameDataManager$InitGame.class 1KB
GameDataManager.class 6KB
ZASM.class 1KB
ZapperCanvas.class 18KB
timeKeeper.class 950B
src
ZapperTimer.java 1KB
timeKeeper.java 1KB
ZASM.java 1KB
GameDataManager.java 13KB
ZapperCanvas.java 46KB
Road.java 8KB
Car.java 11KB
SoundPlayer.java 3KB
res
car1.png 1KB
road.png 2KB
signal.png 420B
flag2.png 648B
hiscore.ott 43B
signal.ott 13B
fuel1.png 20B
arrow.png 155B
logo.png 1KB
lap1.png 26B
car0.png 1KB
lap.ott 26B
outoftime.png 645B
hiscore1.png 43B
p1.png 1KB
p2.png 5KB
title.png 11KB
signal1.png 13B
bumper.png 2KB
hall1.png 35B
bg1.png 64B
car5.png 1KB
bg.png 2KB
hall.ott 35B
fuel.png 183B
bg.ott 64B
car3.png 1KB
start.png 3KB
car2.png 1KB
tyre1.png 204B
fuel.ott 20B
indiagames.png 3KB
startline.png 686B
inside.png 246B
keyboard.png 3KB
car2
car1.png 1KB
Thumbs.db 29KB
car0.png 1KB
car5.png 2KB
car3.png 1KB
car2.png 1KB
car4.png 1KB
icon.png 327B
car4.png 1KB
finish.png 643B
car1
car1.png 1KB
Thumbs.db 28KB
car0.png 1KB
car5.png 1KB
car3.png 2KB
car2.png 2KB
car4.png 2KB
bin
JCKB_S60.jad 349B
MANIFEST.MF 243B
JCKB_S60-properties
default_rms_%6e05%9664%6570%636e1.db 48B
default_rms_%6e05%9664%6570%636e2.db 48B
default_rms_%6e05%9664%6570%636e.db 48B
JCKB_S60.exe 198KB
JCKB_S60.jar 130KB
tmplib
tmpclasses
SoundPlayer.class 2KB
ZapperTimer.class 752B
Road.class 3KB
Car.class 5KB
GameDataManager$InitGame.class 1KB
GameDataManager.class 5KB
ZASM.class 1KB
ZapperCanvas.class 16KB
timeKeeper.class 853B
共 88 条
- 1
资源评论
「已注销」
- 粉丝: 119
- 资源: 213
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功