コード例 #1
0
ファイル: Racket.java プロジェクト: hagward/Indaprojekt
 public Racket(float x, float y) {
   super(x, y, 80, 16);
   resources = ResourceLoader.getInstance();
   xSpeed = 0;
   ySpeed = 0;
   image = resources.getImage("racket.png");
 }
コード例 #2
0
  panel() { // this is the game screen

    setLayout(new BorderLayout());
    setBackground(Color.white);

    rabbit = ResourceLoader.getImage("rabbit.jpg");
    rabbitHit = ResourceLoader.getImage("rabbitHit.png");
    gunRR = ResourceLoader.getImage("gunRR.jpg");
    gunRC = ResourceLoader.getImage("gunRC.jpg");
    gunCC = ResourceLoader.getImage("gunCC.jpg");
    gunLC = ResourceLoader.getImage("gunLC.jpg");
    gunLL = ResourceLoader.getImage("gunLL.jpg");
    currentImage = gunCC;

    timer = new Timer(5, new MoveRabbit());
    timer2 = new Timer(5, new MovePlus());

    ImageIcon gunIcon = new ImageIcon(currentImage);
    ImageIcon rabbitIcon = new ImageIcon(rabbit);

    JLabel rabbitLabel = new JLabel(rabbitIcon);
    JLabel gunLabel = new JLabel(gunIcon);

    addMouseListener(new ClickTarget());
    addMouseMotionListener(new MouseMovement());

    timer.start();
  }
コード例 #3
0
ファイル: Racket.java プロジェクト: hagward/Indaprojekt
 public void removeLasers() throws SlickException {
   lasers = null;
   image = resources.getImage("racket.png").getScaledCopy((int) width, (int) height);
 }
コード例 #4
0
ファイル: Racket.java プロジェクト: hagward/Indaprojekt
 public void addLasers(PowerUp.PewPewLasers lasers) throws SlickException {
   this.lasers = lasers;
   image = resources.getImage("laserracket.png").getScaledCopy((int) width, (int) height);
 }
コード例 #5
0
 public Image getLifeUpImg() {
   ImageIcon ic = new ImageIcon(ResourceLoader.getImage("lifeup.png"));
   return ic.getImage();
 }