public Racket(float x, float y) { super(x, y, 80, 16); resources = ResourceLoader.getInstance(); xSpeed = 0; ySpeed = 0; image = resources.getImage("racket.png"); }
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(); }
public void removeLasers() throws SlickException { lasers = null; image = resources.getImage("racket.png").getScaledCopy((int) width, (int) height); }
public void addLasers(PowerUp.PewPewLasers lasers) throws SlickException { this.lasers = lasers; image = resources.getImage("laserracket.png").getScaledCopy((int) width, (int) height); }
public Image getLifeUpImg() { ImageIcon ic = new ImageIcon(ResourceLoader.getImage("lifeup.png")); return ic.getImage(); }