Skip to main content
deleted 9 characters in body
Source Link
Laurent Couvidou
  • 9.2k
  • 2
  • 42
  • 58

I'm not familiar with the Android SDK, but seeing the error you have it seems that you're somehow not "freeing" you menu when you switch to your level. As Android can't display two of those SurfaceViews at the same time, it squeaks and halts your program. Maybe there's something you have to do on your menu view, some method to call to detach it from the screen, before you create and attach another view? Maybe you should completely destroy your menu before instantiating your level? Maybe you can have only one view for your whole app, so there's no way to switch between views?

I don't know any tutorial either, but my bet is that you'll find some demo in the SDK.

Oh, and if your game has only a few game states, using a scene stack for this might be overkill. A simple FSM for your is way enough if you just have say a menu, a gameplay state and a credits screen.

I'm not familiar with the Android SDK, but seeing the error you have it seems that you're somehow not "freeing" you menu when you switch to your level. As Android can't display two of those SurfaceViews at the same time, it squeaks and halts your program. Maybe there's something you have to do on your menu view, some method to call to detach it from the screen, before you create and attach another view? Maybe you should completely destroy your menu before instantiating your level? Maybe you can have only one view for your whole app, so there's no way to switch between views?

I don't know any tutorial either, but my bet is that you'll find some demo in the SDK.

Oh, and if your game has only a few game states, using a scene stack for this might be overkill. A simple FSM for your is way enough if you just have say a menu, a gameplay state and a credits screen.

I'm not familiar with the Android SDK, but seeing the error you have it seems that you're somehow not "freeing" you menu when you switch to your level. As Android can't display two of those SurfaceViews at the same time, it squeaks and halts your program. Maybe there's something you have to do on your menu view, some method to call to detach it from the screen, before you create and attach another view? Maybe you should completely destroy your menu before instantiating your level? Maybe you can have only one view for your whole app, so there's no way to switch between views?

I don't know any tutorial either, but my bet is that you'll find some demo in the SDK.

Oh, and if your game has only a few game states, using a scene stack for this might be overkill. A simple FSM is way enough if you just have say a menu, a gameplay state and a credits screen.

Source Link
Laurent Couvidou
  • 9.2k
  • 2
  • 42
  • 58

I'm not familiar with the Android SDK, but seeing the error you have it seems that you're somehow not "freeing" you menu when you switch to your level. As Android can't display two of those SurfaceViews at the same time, it squeaks and halts your program. Maybe there's something you have to do on your menu view, some method to call to detach it from the screen, before you create and attach another view? Maybe you should completely destroy your menu before instantiating your level? Maybe you can have only one view for your whole app, so there's no way to switch between views?

I don't know any tutorial either, but my bet is that you'll find some demo in the SDK.

Oh, and if your game has only a few game states, using a scene stack for this might be overkill. A simple FSM for your is way enough if you just have say a menu, a gameplay state and a credits screen.