资源简介
压缩包了都有说明,自己写的能在我的手机上nokia6630运行
代码片段和文件信息
import java.util.Random;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
//奖励物品类
public class Bonus extends Sprite {
//是否激活初始不激活
private boolean isAlive=false;
//奖励物品种类
public int bonusType;
public final static int ADD_BULLET_BONUS=0;
public final static int SPEED_UP_BONUS=1;
public final static int ADD_LIFE_BONUS=2;
public final static int DISPERSE_BULLET_BOUNS=3;
public final static int ADD_SCORE=4;
//奖励物品高宽
private int frameWidthframeHeight;
//画布高宽
private int canvasWidthcanvasHeight;
private Image imgBonus;
private Bonus bonus;
private Random random;
//奖励物品随机移动方向
private int direction;
public final static int LEFT_DOWN=0;
public final static int RIGHT_DOWN=2;
public final static int MIDDLE_DOWN=1;
public final static int RIGHT_UP=3;
public final static int UP_UP=4;
public final static int LEFT_UP=5;
//奖励物品碰到屏幕边缘次数
private int reflexNum;
public Bonus(Image image int frameWidth int frameHeightint bonusType) {
super(image frameWidth frameHeight);
// TODO Auto-generated constructor stub
imgBonus=image;
this.bonusType=bonusType;
this.frameWidth = frameWidth;
this.frameHeight = frameHeight;
defineReferencePixel(frameWidth / 2 frameHeight / 2);
random=new Random();
direction = (random.nextInt() & 0x0fffffff) % 3;
reflexNum=0;
}
public void setCanvasSize(int canvasWidth int canvasHeight) {
this.canvasWidth = canvasWidth;
this.canvasHeight = canvasHeight;
}
public void setAlive(int x int y) {
isAlive = true;
setPosition(x y);
}
public void setAlive(boolean isAlive) {
this.isAlive = isAlive;
}
public boolean isAlive() {
return isAlive;
}
public Image getImage(){
return imgBonus;
}
public void tick(){
if (isAlive) {
switch (direction) {
case LEFT_DOWN:
move(-4 4);
break;
case RIGHT_DOWN:
move(4 4);
break;
case MIDDLE_DOWN:
move(0 6);
break;
case RIGHT_UP:
move(4 -4);
break;
case UP_UP:
move(0 -4);
break;
case LEFT_UP:
move(-4 -4);
break;
}
if (getX() <= 0) {
switch (direction) {
case LEFT_DOWN:
direction = RIGHT_DOWN;
break;
case LEFT_UP:
direction = RIGHT_UP;
break;
}
reflexNum++;
}
if (getX() >= canvasWidth-frameWidth) {
switch (direction) {
case RIGHT_DOWN:
direction = LEFT_DOWN;
break;
case RIGHT_UP:
direction = LEFT_UP;
break;
}
reflexNum++;
}
if (getY() <= 0) {
switch (direction) {
case LEFT_UP:
direction = LEFT_DOWN;
break;
case UP_UP:
direction = MIDDLE_DOWN;
break;
case RIGHT_UP:
direction = RIGHT_DOWN;
break;
}
reflexNum++;
}
if (getY() >= canvasHeight-frameHeight) {
switch (direction) {
case LEFT_DOWN:
direction = LEFT_UP;
break;
ca
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 242 2008-06-16 20:20 ShotPlane\.classpath
文件 244 2008-06-16 20:20 ShotPlane\.eclipseme
文件 222 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\emulation\ShotPlane.jad
文件 275369 2008-06-16 20:20 ShotPlane\.eclipseme.tmp\emulation\ShotPlane.jar
文件 229 2008-06-16 20:19 ShotPlane\.eclipseme.tmp\emulation\shotPlaneGame.jad
文件 92993 2008-06-16 20:19 ShotPlane\.eclipseme.tmp\emulation\shotPlaneGame.jar
目录 0 2008-11-20 17:52 ShotPlane\.eclipseme.tmp\emulation
文件 2969 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\Bonus.class
文件 3117 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\Boss.class
文件 6411 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\Bullet.class
文件 8055 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\EnemyPlane.class
文件 1338 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\GameMIDlet.class
文件 1710 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\Plane.class
文件 3953 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\Pla
文件 48874 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\ShotPlaneGameCanvas.class
文件 2096 2008-06-30 22:27 ShotPlane\.eclipseme.tmp\verified\classes\Sound.class
目录 0 2008-11-20 17:52 ShotPlane\.eclipseme.tmp\verified\classes
目录 0 2008-11-20 17:52 ShotPlane\.eclipseme.tmp\verified\libs
目录 0 2008-11-20 17:52 ShotPlane\.eclipseme.tmp\verified
目录 0 2008-11-20 17:52 ShotPlane\.eclipseme.tmp
文件 26431 2008-06-16 20:19 ShotPlane\.me
文件 50990 2008-06-16 20:19 ShotPlane\.me
目录 0 2008-11-20 17:52 ShotPlane\.me
文件 850 2008-06-16 20:19 ShotPlane\.me
目录 0 2008-11-20 17:52 ShotPlane\.me
文件 11702 2008-06-16 20:19 ShotPlane\.me
文件 2769 2008-06-16 20:19 ShotPlane\.me
目录 0 2008-11-20 17:52 ShotPlane\.me
文件 277 2008-06-16 20:19 ShotPlane\.me
目录 0 2008-11-20 17:52 ShotPlane\.me
............此处省略514个文件信息
相关资源
- MT7622 datasheet预览版
- J2ME手机游戏毕业设计
- MTK_6735_pcb_sch.zip
-
MediaTek li
nkIt Smart 7688开发者指南_M - MTK+PC+Simulator
- 11830@52RD_11A添加APP.rar
- J2ME游戏开发教程 pdf文件
- MTK Secure Boot V1.1.pdf
- 大名鼎鼎的开源PACS 加速DICOM开发
- J2ME手机游戏开发自学源代码
- MTK平台MMI培训教程-手机开发入门必看
- MTK Download tool Source code
- J2ME 手机游戏 《打地鼠》用于毕业设
- mtk2503 gps 北斗测试工具
- J2ME 中文教程
- MTK刷机工具FlashTool_v2.9.1001
- J2ME模拟器 KEmulator Lite V0.9.8 中文版
- mtk手机专属联机驱动
- 走出山寨-MTK芯片开发指南+完整版.p
- WTK2.2 J2ME开发工具
- MTK6735教程
- MT7628MTK官方linuxSDK开发资料和数据手册
- J2ME开发大全()-中文版-PDF
- J2ME手机游戏开发毕业设计论文.pdf
- J2me俄罗斯方块,设计报告
- DCMTK 3.6.4.rarvs2013 X64 Debug
- MTK3360通用刷机固件不带MCU程序迪恩杰
- MT7628_ProgrammingGuide&&MTK_APSoC_SDK_User_Ma
- cocos2d-x飞行射击类游戏整套素材资源
- 3d opengl 飞行射击游戏源码和论文
评论
共有 条评论