这个程序又是怎么回事呢

leeak 2003-08-22 05:50:06
源程序:

import java.awt.*;
import java.applet.*;
public class lp1 extends Applet
{
carton carton_1=null;//declare this is a carton example
public void start()
{
if (carton_1==null)//if example not intailized
{
carton_1=new carton(getGraphics(),this);//intailized or not
carton_1.start();//start or not
}
}
public void paint(Graphics g)
{update(g);}
public void update(Graphics g)
{}
public void stop()
{
carton_1.stop();//example stop?
carton_1=null;//free the resource
}
//key press event
public bollean keyDown(Event e,int key)
{
if (key==Event.UP)//if keypress is up
carton_1.set_direction(0);//bollean is true
if (key==Event.DOWN)//if keypress is down
carton_1.set_direction(1);//bollean is true
if (key==Event.LEFT)//if keypress is left
carton_1.setdirection(2);//bollean is true
if (key==Event.RIGHT)//if keypress is right
carton_1.setdirection(3);//boolean is true
if (key=='s')
{
carton_1.gamerun=true;carton_1.position_x=170;carton_1.position_y=320;}
return true;
}
//key up event
public boolean keyUP(Event e,int key)
{
if (key==Event.UP)//if key up is up
carton_1.clear_direction(0);//boolean up is false
if (key==Event.DOWN)//if key is down
carton_1.clear_direction(1);
if (key==Event.LEFT)
carton_1.clear_direction(2);
if (key==Event.REGHT)
carton_1.clear_direction(3);
if (key=32)
carton_1.fire_wanna_switch(true);
return true;
}
}
//player's class
class carton extends Thread

{
Graphics g,off_screen=null;
boolean up=false,down=false,left=false,right=false;
boolean img_now_switch=true;
boolean fire_wanna=false;
int position_x=170,position_y=320,pos_x,pos_y;
int i=0,j=0,k_left=0,k_right=0;
int bullet_amount_left=0;
int bullet_amount_right=0;
int bullet_position_left[][]=new int[301][2];
int plane_died=-1;
int enemy_lose=0,enemy_bullet_lose=0;
int enemy[][]=new int[31][2];
int enemy_bullet[][]=new int[31][2];
int enemy_dx[]=new int[31];
int enemy_bullet_dx[]=new int[31];
int enemy_amount=0,enemy_bullet_amount=0;
int enemy_plane=0,enemy_ball=0;
int enemy_status[]=new int[31];
int enemy_bullet_status[]=new int[31];
Image img_center,img_right,img_left;
Image img_now;
Image map;
Image enemy_image,enemy_bullet_image,flame,ball;
int mapposX=50,mapposY=50;
Image bullet_left,bullet_right;
Image off_screen_buffer=null;
Applet applet;
int sleep_time=30;
MediaTracker track;
Rectangle enemy_rect[]=new Rectangle[31];
Rectangle enemy_bullet_recnt[]=new Rectangle[31];
boolean gamerun=false;
int killtotalo=0;
}
编译结果:出现一大堆的错
举两个例子: 第一行:lp1.java:24:can not reslove symbol
symbol : class bollean keydown(java.awt.graphics,lp1)
location ;location:carton

以下的都是和这个差不多。这是怎么回事 谢谢
...全文
77 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
leeak 2003-08-22
  • 打赏
  • 举报
回复
ooo 我太傻了
zcjl 2003-08-22
  • 打赏
  • 举报
回复
你也太不仔细了吧
boolean写成了bollean
Ctrl+F自己改去吧

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧