Hi, I am currently coding a SpaceInvaders clone. I am almost done and the last problem I have is with the start screen.
Nevermind the setLocation() methods, the problem I have is that the first setImage() gets ignored, the console gives me a "00" and in the object inspector the left act cycles to sleep over are beeing shown, just ht eimage won't change
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public void act() { if (sleep == 0 ) { System.out.println( "Before sleepFor(30) - Setting image to SpaceMastersStartText.png" ); setLocation(getWorld().getWidth() / 2 , 930 ); setImage( "SpaceMastersStartText.png" ); System.out.println( "00" ); sleep = 10 ; this .sleepFor( 30 ); } if (sleep == 10 ) { System.out.println( "Before sleepFor(30) - Setting image to SpaceMastersBunkerFull.png" ); setLocation(getWorld().getWidth() / 2 , getWorld().getHeight() / 2 ); setImage( "SpaceMastersBunkerFull.png" ); System.out.println( "01" ); sleep = 0 ; this .sleepFor( 30 ); } } } |