0
\$\begingroup\$

I'm new to libGDX (I just released my first game), and I've started thinking about things I'd like to do next time. One thing I really want to do is, have those story type movies, where you tap the screen to advance the dialog. I'm specifically thinking of Pokemon Mystery Dungeon. A small action happens, and then the user has to tap the screen after reading what happened to move on.

My question is how can I do this? I've done a lot of research, but I can't seem to find out how to approach this. I have this vague idea where I create a different GameState using enum types in which the gameplay is modified but I don't know if there is a better way.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You would be correct in your assumption that you need to create a better "Game State Management" system for use in your game. This is how you control how the game is working.

Think about when a game is Paused. Nothing is happening, it's just waiting for the User to un-pause the game. This is essential in what you would want to do.

A basic GameState might consist of an enum like such

Menu
Playing
Paused
Credits

Which you can probably derive what each state does for the user.

You could add in a state of "cinematic" or something of that nature. I've never used libGDX, but essentially you "manage" game states by just not calling certain functions.

So to "Pause" a game, you'd set the gamestate to paused, which would not call the function that updates game logic. It just sits there, looping to receive input, so it can to be told it can call the game logic again.

Cinematic comes up
GameState set to Cinematic
Halts other logic, waits for user selection
User selects option
GameState switched to other state
Game continues

There are a lot of easy to ready gamestate examples written for XNA...even if you don't know c#, you could understand the logic just by looking at them. I'd suggest studying them.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks a lot! Having my suspicion confirmed by someone else is awesome. And thanks for your awesome explanation. Putting the game in a state where it's similar to a paused state makes sense to me. I'll also look into XNA (not sure what it is yet, but I will find out!) \$\endgroup\$
    – zyzz
    Dec 22, 2014 at 16:37
  • \$\begingroup\$ XNA is a c# framework for directx by Microsoft, being c# the code is very readable, glad I could help. \$\endgroup\$ Dec 22, 2014 at 16:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .