求J2ME游戏代码

求J2ME游戏代码,小型简单的就可以了,要能运行啊,拜托了,发到邮箱:372267579@qq.com... 求J2ME游戏代码,小型简单的就可以了,要能运行啊,拜托了,发到邮箱:372267579@qq.com 展开
 我来答
jaycn040718
2011-11-25 · TA获得超过381个赞
知道小有建树答主
回答量:640
采纳率:0%
帮助的人:405万
展开全部
我给你发了3个游戏的代码,是我上学的时候我们小组开发的,算是简单的了。但是因为是用MVC模式开发的,包比较多。
一个ARPG游戏,一个塔防游戏,一个冒险类的
如果你想要跟复杂点的游戏或是更简单点的游戏我再给你整理
分我不要了,不蒸馒头争口气吧
百度网友98abf1f
2011-11-25 · TA获得超过1836个赞
知道大有可为答主
回答量:1961
采纳率:0%
帮助的人:1288万
展开全部

我尾号197的给你发了个注释非常详细的贪吃蛇的代码,就是j2me做的。

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
proof961
2011-11-25 · 超过13用户采纳过TA的回答
知道答主
回答量:276
采纳率:0%
帮助的人:199万
展开全部
你是选择继续,还是停留?不管如何,世界的命运已经掌握在你的手中。当战机翱翔在天际之时,就是敌人的阴谋破灭的时刻!史上最经典的射击游戏。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2011-11-26
展开全部
import javax.swing.JOptionPane;
public class GuessNumber
{
public static void main (String args[ ])
{

JOptionPane.showMessageDialog(null, "给你一个1至100之间的整数,请猜测这个数");
int realNumber=(int)(Math.random()*100)+1;
int yourGuess=0;
String str=JOptionPane.showInputDialog("输入您的猜测:");
yourGuess=Integer.parseInt(str);
while(yourGuess!=realNumber) //循环条件
{
if(yourGuess>realNumber) //条件代码
{
str=JOptionPane.showInputDialog("猜大了,再输入你的猜测:");
yourGuess=Integer.parseInt(str);
}
else if(yourGuess<realNumber) //条件代码
{
str=JOptionPane.showInputDialog("猜小了,再输入你的猜测:");
yourGuess=Integer.parseInt(str);
}
}

JOptionPane.showMessageDialog(null, "猜对了!该数为:"+realNumber);
}
}

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

public class GuessNumberFrame extends Frame implements ActionListener,WindowListener,KeyListener{
Button buttonGetNumber,buttonEnter;
Label labelShow;
TextField textInput;
int realNumber;
public GuessNumberFrame() {
super("猜数字游戏");
this.setSize(200,180);
this.setLocation(300,300);
this.setBackground(Color.lightGray);
int width=Toolkit.getDefaultToolkit().getScreenSize().width;
int height=Toolkit.getDefaultToolkit().getScreenSize().height;
this.setLocation((width-300)/2,(height-310)/2);
this.setResizable(false);
this.setLayout(new FlowLayout(1,5,15));

buttonGetNumber=new Button("得到一个随机数");

this.add(buttonGetNumber);
buttonGetNumber.addActionListener(this);

labelShow=new Label("欢迎使用,猜数字游戏:",Label.CENTER);
labelShow.setBackground(Color.orange);
this.add(labelShow);

textInput=new TextField(10);
this.add(textInput);
textInput.addKeyListener(this);

buttonEnter=new Button("确定");
this.add(buttonEnter);

buttonEnter.addActionListener(this);
this.addWindowListener(this);

this.setVisible(true);
}

public void actionPerformed(ActionEvent e) {
if(e.getSource()==buttonGetNumber){
realNumber=(int)(Math.random()*100)+1;
labelShow.setText("请输入你的猜测");
textInput.requestFocus();
}
if(e.getSource()==buttonEnter){
eventc();

}

}
public void keyPressed(KeyEvent e) {
if(e.getKeyCode()==KeyEvent.VK_ENTER){
eventc();
}

}
public void eventc(){
try{
int guess=Integer.parseInt(textInput.getText());
if(guess==realNumber){
labelShow.setText("猜对了");
}
else if (guess>realNumber) {
labelShow.setText("猜大了");

textInput.requestFocus();
}
else if (guess<realNumber) {
labelShow.setText("猜小了");

textInput.requestFocus();
}
}catch (NumberFormatException e1) {
labelShow.setText("请重新输入数字");
}
}

public void windowClosing(WindowEvent e) {
System.exit(0);
}

public void windowActivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowOpened(WindowEvent e) {}
public void keyReleased(KeyEvent e) {}
public void keyTyped(KeyEvent e) {}
}
class GuessNumberFrame_ex{
public static void main(String[] args){
new GuessNumberFrame();
}
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
ghfj007
2011-11-25
知道答主
回答量:50
采纳率:0%
帮助的人:10.4万
展开全部
你上百度找下CNSD 在这里能找到不少J2ME的游戏代码的 有不少人在这里共享
追问
我去了,但是申请不了账号,老说我验证邮箱不行。。。
追答
不好意思打错给你了是CSDN 这里
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(3)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式