Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/440343083600060417
More descriptive tile. Clarified content and formatting.
Source Link
Anko
  • 13.5k
  • 10
  • 56
  • 82

Implementing game over How should I implement a Game Over menu (Android / OpenGL ES 2)in Android?

Take pretty much any mobile game: when you dieBy Game Over menu, I mean a menu is displayed that haswhen you die, with an option to play again.

I have two approaches in mind:

1. Use OpenGL

As in haves some button textures ready and when the character dies, translate them to the screen. Then listen for events on those textures.

2. Use a view

At the moment, when the user opens the game, I have a basic activity, along with a basic view that has a FrameLayout: the root is a GlSurfaceView and on top of it there's a menu (embedded in a LinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only the GlSurfaceView visible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.

  1. Use OpenGL

    Have some button textures ready. When the character dies, draw them. Listen for events on those textures.

  2. Use a view

    (This is what I'm doing now.) When the user opens the game, I have a basic activity, along with a basic view with a FrameLayout: The root is a GlSurfaceView and there's a menu on top of it (embedded in a LinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only the GlSurfaceView visible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.

I don't particularly like the first approach, since implementing the button events in OpenGL doesn't seem like a straightforward thingseems hard. So how is it done after all

How should I approach this?

Implementing game over menu (Android / OpenGL ES 2)

Take pretty much any mobile game: when you die, a menu is displayed that has an option to play again.

I have two approaches in mind:

1. Use OpenGL

As in haves some button textures ready and when the character dies, translate them to the screen. Then listen for events on those textures.

2. Use a view

At the moment, when the user opens the game, I have a basic activity, along with a basic view that has a FrameLayout: the root is a GlSurfaceView and on top of it there's a menu (embedded in a LinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only the GlSurfaceView visible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.

I don't particularly like the first approach, since implementing the button events in OpenGL doesn't seem like a straightforward thing. So how is it done after all?

How should I implement a Game Over menu in Android?

By Game Over menu, I mean a menu displayed when you die, with an option to play again.

I have two approaches in mind:

  1. Use OpenGL

    Have some button textures ready. When the character dies, draw them. Listen for events on those textures.

  2. Use a view

    (This is what I'm doing now.) When the user opens the game, I have a basic activity, along with a basic view with a FrameLayout: The root is a GlSurfaceView and there's a menu on top of it (embedded in a LinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only the GlSurfaceView visible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.

I don't particularly like the first approach, since implementing button events in OpenGL seems hard.

How should I approach this?

Source Link
async
  • 745
  • 1
  • 7
  • 23

Implementing game over menu (Android / OpenGL ES 2)

Take pretty much any mobile game: when you die, a menu is displayed that has an option to play again.

I have two approaches in mind:

1. Use OpenGL

As in haves some button textures ready and when the character dies, translate them to the screen. Then listen for events on those textures.

2. Use a view

At the moment, when the user opens the game, I have a basic activity, along with a basic view that has a FrameLayout: the root is a GlSurfaceView and on top of it there's a menu (embedded in a LinearLayout). When the user hits "Play", this menu is translated away (using a translate animation) from the screen, leaving only the GlSurfaceView visible, with which the user can interact. I was thinking of implementing something similar when the game ends, but I'm not sure where to start.

I don't particularly like the first approach, since implementing the button events in OpenGL doesn't seem like a straightforward thing. So how is it done after all?