Joined: Tue Mar 27, 2007 10:55 pm Posts: 2277 Location: Earth Has thanked: 39 time Have thanks: 61 time
* Project Name:
Rapid Roll game * Programmer:subrahmanyeswararao * Type:Multithreading * Technology:Java * IDE:Any * Description:I developed this game in JAVA using AWT and THREADS cocepts. Use left and right arrows to play the game. Give me feedback on my coding
Code:
import java.awt.*; //CHANGE THE scrollSpeed value import java.awt.event.*; //to run the thread with more speed import java.util.*; import java.io.*;
class HighSc {
int hsc; BufferedReader br; FileInputStream fis; String sths; public String getHighScore() throws IOException { fis = new FileInputStream("highscore.txt"); br = new BufferedReader(new InputStreamReader(fis));
sths = br.readLine();
fis.close(); return sths; }
}
class GameFrame extends Frame implements Runnable, KeyListener ,ActionListener {
MenuBar mb; Menu m1; MenuItem mi1,mi2,mi3,mi4,mi5,mi6;
Button b1,b2,b3; Button ball; Button oneUp;
final int TOPLINE = 50; final int BOTTOMLINE = 350; final int LEFTLINE = 20; final int RIGHTLINE = 350 ;
int scrollSpeed = 25;
int x=50, y=300; int x2=125,y2=200; int x3 = 90,y3=100; int bx = 80; int by = 239; int ox = 0; int oy = 0; int score = 0; int oneUpCount = 1;
int t1,t2,t3;
int chances=3; int a,b,c; int diff = 65; String msg = ""; String chns = ""; String st = "";