>>>>>>>>>>>急 程序编译无错 可appletviewer的效果中 箭头不改变方向
下面这段程序 程序已经编译成功 但运行出的效果中 似乎改变arrow方向的代码并没有执行喔
请问程序哪里出错了
//神枪手游戏
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.*;
public class d2_01 extends JApplet implements ActionListener,
MouseListener,MouseMotionListener
{
private Timer timer1,timer2,timer3;
private ImgJPanel pan1;
private Image image1;
private JButton command;
//命令按钮的图片文件名数组
private String but_picname[]={"pic/start.jpg","pic/stop.jpg"};
//成绩显示标签
private JLabel score1= new JLabel("score : 0");
//时间显示标签
private JLabel time1=new JLabel("0");
//显求发射器图案的标签
private JLabel center1;
//显示发射位置箭头的标签
private JLabel weapon;
//反馈信息标签
private JLabel feedback = new JLabel("Successful!", JLabel.CENTER);
//存放图库的数组
private ImageIcon arrow[]=new ImageIcon[36];
private ImageIcon body[]=new ImageIcon[2];
private ImageIcon center_icon;
private ImageIcon but_icon[]=new ImageIcon[2];
private JLabel arrow_list[]=new JLabel[10];
private JLabel body_list[]=new JLabel[10];
//游戏状态变量
private int game_status;
private int p_score,p_time,px,py,pangle;
private int center_x=256;
private int center_y=308;
private int flaglist[]=new int[10];
private int counterlist[]=new int[10];
private int pathno[]=new int[30];
private int shiftlist[]=new int[30];
private int offsetx[]=new int[10];
private int offsety[]=new int[10];
private int arrow_flag[]=new int[10];
private int arrow_offsetx[]=new int[10];
private int arrow_offsety[]=new int[10];
private int arrow_shift[]=new int[10];
private int arrow_rotation[]=new int[10];
private int tpath[][]={
{0,115,500,115},
{500,85,0,85},
{0,45,500,45},
{500,145,0,145}
};
//初始化applet
public void init()
{
//赋值变量c等于ContentPane
Container c=getContentPane();
c.setLayout(null);
c.setSize(500,400);
//加载背景图案
try {image1 = getImage(new URL(getCodeBase(),
"pic/background.jpg")); }
catch(MalformedURLException e) {System.out.println(
"下载图片文件发生错误 URL:"+e+"\n"); return; }
//建立一个放置所有组件的panel
pan1=new ImgJPanel(image1);
pan1.setLayout(null);
//设定pane1的尺寸
pan1.setSize(500,400);
pan1.addMouseListener(this);
pan1.addMouseListener(this);
try {
//加载命令按钮的图案
for(int i=0;i<2;i++){
but_icon[i]=new ImageIcon(new URL(getCodeBase(),
but_picname[i]));
}
}