分类：电脑/网络-程序设计
问题：求一个游戏程序要代码急 
要急
回答：给你个反弹球java的编译下就行了applet的安装jdk代码如下import  t.*;import java.applet.*;public class Ball extends Applet implements Runnable{  int X,Y,moveX,moveY,width,height;  Thread newThread;  Image OffScreen;  Graphics drawOffScreen;    public void init() {        X=0;    Y=0;    moveX=2;    moveY=3;    width =getSize().width;    height=getSize().height;    OffScreen=createImage(width,height);    drawOffScreen= tGraphics();      }    public void start()  {    newThread=new Thread(this);     art();  }    public void stop()    {      newThread=null;    }      public void paint(Graphics g) {   tColor(Color.blue);   llRect(0,0,width,height);       tColor( d);   llOval(X,Y,30,30);//   llOval(60,60,30,30);  g.drawImage(OffScreen,0,0,this);  }    public void update(Graphics g)  {    paint(g);  }  public void run()  {    while(newThread!=null)    {      repaint();    try    {       eep(50);    }    catch(InterruptedException E){}    X=X+moveX;    Y=Y+moveY;        if(X>=(width-30))    {      X=width-30;      moveX=-moveX;    }    if(X<=0)    {      X=0;        moveX=-moveX;        }        if(Y>=(height-30))        {          Y=height-30;          moveY=-moveY;        }        if(Y<=0)        {          Y=0;          moveY=-moveY;        }    }}}