程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> JSP編程 >> 關於JSP >> J2ME小游戲-fly

J2ME小游戲-fly

編輯:關於JSP

1、FlyMidlet.java
package fly;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class FlyMidlet extends MIDlet {
Navigate ng;
public FlyMidlet() {
ng=Navigate.getInstance(this);
}
protected void startApp() {
System.out.println("startApp");
ng.display.setCurrent(ng.mc);
printInfo();
}
protected void pauseApp() {
System.out.println("pauseApp");
}
protected void destroyApp(boolean parm1) {
System.out.println("destroyApp");
Navigate.mc.stop();
MyGameCanvas.cleanJob();
Navigate.cleanJob();
}
private void printInfo(){
System.out.println("FlyMidlet printInfo() start:");
System.out.println("FlyMidlet printInfo() end:");
}
}
2、Bullets.java
package fly;
import javax.microedition.lcdui.game.*;
import javax.microedition.lcdui.*;
import java.util.Random;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class Bullets extends GameObject {
private int[][] bullets;
private int bulletstotal;
private Random rnd;
public static final int BULLET_TYPE_LEFT=0;
public static final int BULLET_TYPE_RIGHT=1;
public static final int BULLET_TYPE_TOP=2;
public static final int BULLET_TYPE_BOTTOM=3;
private int width,height;
public Bullets(Image img,int picwidth,int picheight,int bulletstotal,int width,int height) {

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved