public void setState(States s, boolean stopSound) {
   if (stopSound) Game.res.stopAllSound();
   if (gs != null) gs.dispose();
   if (s == States.SPLASH) {
     gs = new SplashState(this);
   }
   if (s == States.TITLE) {
     gs = new TitleState(this);
   }
   if (s == States.CREDITS) {
     gs = new CreditState(this);
   }
   if (s == States.LEVELSELECT) {
     gs = new LevelSelectState(this);
   }
   if (s == States.PLAY) {
     gs = new PlayState(this);
   }
 }
 public void dispose() {
   gs.dispose();
 }