Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 2:21 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: HarryPotter-Quiz
PostPosted: Fri Jun 08, 2007 10:23 am 
Offline

Joined: Mon Jun 04, 2007 2:02 pm
Posts: 8
Hi,

I try to make a little harry potter quiz game for my girlfriend.

If someone want to test it (at the moment without music and only with german questions): Click here

Screenshots:
Image
Image

It's ready so far but I have 2 little questions:
When I use music and call System.exit(0); ,
the program is shut down but java is still running ...
Without the music everything works fine.
Code:
   /** the main music from the HarryPotter film */
   private Music mainTheme;
...

   public void update(GameContainer gameContainer, StateBasedGame stateBasedgame, int delta) throws SlickException {
      ...
      
      if (LoadingList.get().getRemainingResources() > 0) {
         nextResource = LoadingList.get().getNext();
      } else {
         if (!bStarted) {
            bStarted = true;
            this.mainTheme.loop();
         }
      }
   }
   
   ...
   
   public void mouseReleased( int button, int newX, int newY ) {
      if ( button == 0 ) {
         for ( int i = 0; i < this.buttons.length; i++ ) {
            if ( this.buttons[i].getReleased( newX, newY ) ) {
               String function = this.buttons[i].getFunction();
               if ( "Exit".equals( function ) ) {
                  System.exit( 0 );
                  break;
               }
            }
         }
      }
   }
   
...

   public void enter(GameContainer container, StateBasedGame game)   throws SlickException
   {
      super.enter(container, game);
      if(this.mainTheme == null)
      {
         this.mainTheme = new Music( "sounds/mainTheme.xm" );
      }
   }


And my last question:
I want to use an icon, but nothing works ...
Code:
game.setIcons(new String[] {"images/icon.png", "images/icon24.png"});

Is there anything special to do I didn't notice???


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 12:00 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Try calling GameContainer.exit() - that might stop the music before hand - if it doesn't it probably should do. What build of slick are you currently using?

Icons have to specific sizes for different platforms (16x16 and 24x24 for windows).

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 12:36 pm 
Offline

Joined: Mon Jun 04, 2007 2:02 pm
Posts: 8
GameContainer.exit() - doesn't work. I have the same problem. I don't know why. I also try an ogg file but the same problem ...
I use Slick Build #167.

My icons are 16x16 and 24x24 and I use windows ... mhh strange


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 12:49 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Could you log a bug on the music thing. It's definitely wierd.

Icons - could you create a test case so I can reproduce.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group