Results 1 to 3 of 3
  1. #1
    vastrolorde is offline Senior Member
    Join Date
    Jan 2013
    Posts
    124
    Rep Power
    0

    Default Why isnt a image showing up when conditions are met?

    Java Code:
    boss = new ArrayList<Boss>();
    		boss.add(new Boss(pos[25][0], pos[25][1]));
    
    Boss b = (Boss)boss.get(0);
    			if(b.isVisible())
    				g2d.drawImage(b.getImage(), b.getX(), b.getY(), this);
    
    
      if (aliens.size()==0) {
    			Boss b = (Boss)boss.get(0);
    			b.setVisible(true);
            }
    
    Boss b = (Boss) boss.get(0);
    			Rectangle r4 = b.getBounds();
    			
    			if(r1.intersects(r4)){
    				hit -= 1;
    				m.setVisible(false);
    				if(hit == 0){
    					b.setVisible(false);
    					BoSs = 1;
    					}
    				}
    What is wrogn whit these parts of codes. Everything else works fin. The crafts keep appearing on the screen until shot down, but once the bos sshould appear it does nothing.

  2. #2
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    317
    Rep Power
    4

    Default Re: Why isnt a image showing up when conditions are met?

    Have you checked to ensure the condition on line 9 is being met?

    Regards.

  3. #3
    vastrolorde is offline Senior Member
    Join Date
    Jan 2013
    Posts
    124
    Rep Power
    0

    Default Re: Why isnt a image showing up when conditions are met?

    i changed the initiation of the boss and i got it working. insted of boss = new ArrayList<Boss>(); boss.add(new Boss(pos[25][0], pos[25][1])); i used boss = new Boss()

Similar Threads

  1. My program is running, but it isnt showing up...
    By MW130 in forum New To Java
    Replies: 7
    Last Post: 01-15-2013, 03:55 AM
  2. image and background not showing.
    By gameaddict123 in forum New To Java
    Replies: 2
    Last Post: 06-17-2011, 03:52 AM
  3. Image not showing up!!
    By ThrashingBoy in forum New To Java
    Replies: 1
    Last Post: 11-08-2010, 10:22 PM
  4. Replies: 9
    Last Post: 09-30-2008, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •