import java.io.IOException;
import java.io.InputStream;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.lcdui.game.TiledLayer;
import javax.microedition.media.Manager;
import javax.microedition.media.MediaException;
import javax.microedition.media.Player;
public class BaiNaShanCanvas extends GameCanvas implements Runnable {
FireMIDlet mid;
BaiNaShanCanvas bcanvas;
MenuCanvas mcanvas;
boolean sleeping=false;
Graphics g;
Image map,man,she,ground,ss,knife,box,pao,menuarrow;
Sprite mansprite,knifesprite,menuarrowsprite, box1sprite,box2sprite,box3sprite,box4sprite;
Sprite she1sprite,she2sprite,she3sprite,she4sprite,she5sprite,she6sprite,she7sprite,she8sprite,
she9sprite,she10sprite,she11sprite,she12sprite,she13sprite,she14sprite,she15sprite;
Sprite pao1sprite,pao2sprite,pao3sprite,pao4sprite,pao5sprite,pao6sprite,pao7sprite,pao8sprite,
pao9sprite,pao10sprite,pao11sprite,pao12sprite,pao13sprite,pao14sprite,pao15sprite;
int[] right={9,10,11};
int[] up={6,7,8};
int[] down={0,1,2};
int[] left={3,4,5};
int key,paox=-2;
int x=5,y=0,x3=-5,y3=0;
int knifex=0,knifey=0,bb=0,z;;
int num1=0,num2=0,num3=3;
String score="经验:";
String money="金币:";
String life="生命:";
String i1,i2,i3;
String a,b,c,d;
int k1=0,k2=0,k3=0,k4=0;
int shang[]={2},xia[]={1},zuo[]={3},you[]={0};
String z1="剑气凌风";
String z2="剑影留痕";
String z3="人剑合一";
String[] s={"断尘老人:","恭喜你!各种技能修炼成功",",按照指示去寻找地图吧!"};
Font smallFont=Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_SMALL);
Font largeFont=Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_LARGE);
TiledLayer tl;
protected BaiNaShanCanvas(FireMIDlet mid) {
super(true);
g=this.getGraphics();
this.setFullScreenMode(true);
this.mid=mid;
try{
map=Image.createImage("/bb.png");
man=Image.createImage("/man.png");
she=Image.createImage("/she.png");
ground=Image.createImage("/ground.png");
ss=Image.createImage("/ss.png");
knife=Image.createImage("/knife.png");
box=Image.createImage("/box.png");
pao=Image.createImage("/pao.png");
menuarrow=Image.createImage("/menuarrow.png");
}catch(IOException ex){}
mansprite=new Sprite(man,32,48);
mansprite.setPosition(getWidth()/2,getHeight()/2);
mansprite.setFrameSequence(right);
mansprite.setFrame(0);
knifesprite=new Sprite(knife,32,32);knifesprite.setPosition(-32,0);
menuarrowsprite=new Sprite(menuarrow,16,18);
menuarrowsprite.setPosition(0,getHeight()/2);
menuarrowsprite.setVisible(false);
box1sprite=new Sprite(box,30,30);box1sprite.setPosition(90,360);
box2sprite=new Sprite(box,30,30);box2sprite.setPosition(306,108);
box3sprite=new Sprite(box,30,30);box3sprite.setPosition(612,126);
box4sprite=new Sprite(box,30,30);box4sprite.setPosition(900,270);
she1sprite=new Sprite(she,34,33);she1sprite.setPosition(234,54);
she2sprite=new Sprite(she,34,33);she2sprite.setPosition(126,76);
she3sprite=new Sprite(she,34,33);she3sprite.setPosition(270,216);
she4sprite=new Sprite(she,34,33);she4sprite.setPosition(234,396);
she5sprite=new Sprite(she,34,33);she5sprite.setPosition(432,342);
she6sprite=new Sprite(she,34,33);she6sprite.setPosition(450,126);
she7sprite=new Sprite(she,34,33);she7sprite.setPosition(648,54);
she8sprite=new Sprite(she,34,33);she8sprite.setPosition(576,252);
she9sprite=new Sprite(she,34,33);she9sprite.setPosition(720,144);
she10sprite=new Sprite(she,34,33);she10sprite.setPosition(630,396);
she11sprite=new Sprite(she,34,33);she11sprite.setPosition(918,90);
she12sprite=new Sprite(she,34,33);she12sprite.setPosition(990,54);
she13sprite=new Sprite(she,34,33);she13sprite.setPosition(990,198);
she14sprite=new Sprite(she,34,33);she14sprite.setPosition(792,306);
she15sprite=new Sprite(she,34,33);she15sprite.setPosition(954,378);
pao1sprite=new Sprite(pao,15,9);
pao1sprite.setPosition(she1sprite.getX(),she1sprite.getY());
pao2sprite=new Sprite(pao,15,9);
pao2sprite.setPosition(she2sprite.getX(),she2sprite.getY());
pao3sprite=new Sprite(pao,15,9);
pao3sprite.setPosition(she3sprite.getX(),she3sprite.getY());
pao4sprite=new Sprite(pao,15,9);
pao4sprite.setPosition(she4sprite.getX(),she4sprite.getY());
pao5sprite=new Sprite(pao,15,9);
pao5sprite.setPosition(she5sprite.getX(),she5sprite.getY());
pao6sprite=new Sprite(pao,15,9);
pao6sprite.setPosition(she6sprite.getX(),she6sprite.getY());
pao7sprite=new Sprite(pao,15,9);
pao7sprite.setPosition(she7sprite.getX(),she7sprite.getY());
pao8sprite=new Sprite(pao,15,9);
pao8sprite.setPosition(she8sprite.getX(),she8sprite.getY());
pao9sprite=new Sprite(pao,15,9);
pao9sprite.setPosition(she9sprite.getX(),she9sprite.getY());
pao10sprite=new Sprite(pao,15,9);
pao10sprite.setPosition(she10sprite.getX(),she10sprite.getY());
pao11sprite=new Sprite(pao,15,9);
pao11sprite.setPosition(she11sprite.getX(),she11sprite.getY());
pao12sprite=new Sprite(pao,15,9);
pao12sprite.setPosition(she12sprite.getX(),she12sprite.getY());
pao13sprite=new Sprite(pao,15,9);
pao13sprite.setPosition(she13sprite.getX(),she13sprite.getY());
pao14sprite=new Sprite(pao,15,9);
pao14sprite.setPosition(she14sprite.getX(),she14sprite.getY());
pao15sprite=new Sprite(pao,15,9);
pao15sprite.setPosition(she15sprite.getX(),she15sprite.getY());
tl=new TiledLayer(60,30,map,18,18);
tl.setPosition(0,0);
int[][] tiles={
{ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 },
{ 4, 5, 5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5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6 },
{ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6 },
{ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6 },
{ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
J2ME 简单益智小游戏源码 (103个子文件)
BaiNaShanCanvas.class 30KB
BaiNaShanCanvas.class 29KB
SystemCanvas.class 12KB
SystemCanvas.class 11KB
CastleCanvas.class 6KB
CastleCanvas.class 6KB
gameCanvas.class 5KB
ZhanCanvas.class 5KB
gameCanvas.class 5KB
ZhanCanvas.class 5KB
FireMIDlet.class 4KB
StartCanvas.class 4KB
HouseCanvas.class 4KB
FireMIDlet.class 4KB
StartCanvas.class 4KB
HouseCanvas.class 4KB
HelpCanvas.class 4KB
HelpCanvas.class 4KB
MenuCanvas.class 4KB
MenuCanvas.class 3KB
MenuCanvas$1.class 602B
MenuCanvas$1.class 565B
.classpath 242B
.eclipseme 227B
shixun2.jad 263B
shixun2.jad 263B
shixun2.jad 238B
shixun2.jar 322KB
shixun2.jar 304KB
BaiNaShanCanvas.java 37KB
SystemCanvas.java 13KB
CastleCanvas.java 6KB
gameCanvas.java 5KB
ZhanCanvas.java 4KB
HelpCanvas.java 4KB
FireMIDlet.java 4KB
HouseCanvas.java 3KB
MenuCanvas.java 3KB
StartCanvas.java 3KB
background.jpg 52KB
background.jpg 52KB
zhan.jpg 46KB
zhan.jpg 46KB
menuback.jpg 43KB
menuback.jpg 43KB
house.jpg 40KB
house.jpg 40KB
castle.jpg 34KB
castle.jpg 34KB
wordback.jpg 25KB
wordback.jpg 25KB
stage2.mid 7KB
stage2.mid 7KB
ending.mid 6KB
ending.mid 6KB
ss.png 10KB
ss.png 10KB
knife.png 9KB
knife.png 9KB
head2.png 9KB
head2.png 9KB
head1.png 8KB
head1.png 8KB
girl.png 8KB
girl.png 8KB
langya.png 7KB
langya.png 7KB
man.png 7KB
man.png 7KB
oldman1.png 6KB
oldman1.png 6KB
helpback.png 5KB
helpback.png 5KB
jian.png 4KB
jian.png 4KB
system.png 4KB
system.png 4KB
bb.png 3KB
bb.png 3KB
headB.png 3KB
headB.png 3KB
pao.png 3KB
pao.png 3KB
headA.png 3KB
headA.png 3KB
menu.png 2KB
menu.png 2KB
helparrow.png 2KB
helparrow.png 2KB
ground.png 2KB
ground.png 2KB
oldman2.png 2KB
oldman2.png 2KB
logo.png 2KB
logo.png 2KB
she.png 2KB
she.png 2KB
box.png 1KB
box.png 1KB
menuarrow.png 190B
共 103 条
- 1
- 2
资源评论
- 詹素素2015-04-05挺不错呃~可供参考~
- laq19915272014-09-30的确挺益智
幸福VS梦魇
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功