Tycoon type system

Hey guys. I’ve been scarce here lately and had to put my programming efforts on hold for a bit. I just didn’t have the time due to my job. Due to recent events…and a bunch of bullshit. I’m now unemployed and looking for a new job. I’m getting back into coding and hopefully won’t have to stop once I get a new job.

I’m practicing with a tycoon type game and have some questions…

I’m using LibGDX and it’s mainly going to consist of multiple screens…A store screen, stat screen, options screen, etc. and finally a play screen. On the play screen, it will be the same menu style, but the screen will be split in two. The top half will have an isometric mini-world so-to-speak. It will show the players stand, and people walking up to it, walking around, etc. The bottom half will show the time and stats and such.

I’m pretty lost for the most part on going about implementing this. I’m thinking (and i’m not sure on this) that I would have to use Scene2d…Is this correct? or would there be a better way to go about it? It’s basically just going to be a bunch of menus with information on them. I really want to be able to use tabs as well as I plan on making this for android and I think that would be the best way to organize the screens and information.

I’ve never used Scene2d…So far i’ve only made a brickbreaker game and a pacman game…I need something a little more challenging and something I would enjoy programming. brickbreaker and pacman were kind of…boring. I want to get past this learning curve…

ANY information/suggestions/links/articles/tips would be GREATLY appreciated!

Thanks guys!

Anybody?

Basically, what i’m asking is. If the whole game is going to be a UI system with the exception of one small part that will have isometric or orthogonal play area. What would be best to use?

Since you’re using libgdx anyway, what’s wrong with using their scene2d.ui package? Looking over the documentation, it would appear to have enough functionality to do what you want with a minimal of fuss.

I haven’t used libgdx before, but for pretty much any game with a separate screens, you should make an enum of states, and use a switch statement to use the correct code for the menu that your currently on ex:

public class TycoonGameWoo(){
   private static enum State {
   TITLE, STORE, STATSCREEN, OPTIONS, GAME;
   }
   //initialization stuffs
   private State state = State.TITLE
   while(!Display.isCloseRequested){
      switch(state){
         case TITLE: 
         //do title stuff
         break;
         case STORE: 
         //do store stuff
         break;
         case STATSCREEN:
         //show stats
         break;
         case OPTIONS;
         //do options stuff
         break;
         case GAME:
        //do main game stuff
        break;
   }
}

Then if i wanted to change menus I would just do something like this

If(Keyboard.isKeyDown(Keyboard.KEY_RETURN)){
   state = state.GAME;
}

I programmed this in chat, so don’t take it word for word but thats the general idea

scene2d.ui is what I was planning on using. I just didn’t know if there was anything better. I’m finding a lot of old documentation and having some problems getting it going.

Another concern I have with scene2d.ui is I don’t think it has anyway to do a tabbed screen.

Better is a matter of opinion. I’m not really a libgdx user, but I would say that if scene2d.ui can handle what you need, then go with it. Since it’s already a part of libgdx, you won’t have to worry about any potential compatibility quirks with the rest of the library. There are plenty of alternatives, but if you’re wanting to develop for/port your application to mobile, you’ll have to do some digging to see how suitable they are.

As for tabbed screens, it shouldn’t be hard to roll your own using the available widgets. Conceptually a tabbed control is nothing more than a split pane with buttons in one half that set the state for what should be displayed in the other half. If you have to make your tabs “wrap”, you may have to put a little more effort into it, but overall it shouldn’t be too complex one way or the other.

That’s the problem. I’m not exactly sure what it’s capable of. I’m trying to get it going but am having a bit of a problem as to where to start because of the old documentation.

Which set of docs are you looking at. There appears to be one set hosed on Google, and one set hosted on GitHub. Since the main page directs to GitHub, I’d assume that would be the authoritative source. If those are the docs you’re referencing already, then you may want to post a topic asking about the best source for the docs. There are plenty of libgdx users around here, so I’m sure they’d be able to point you in the right direction. The other option would be delving into tutorials, and learning what you need by examples. Unfortunately many of the libraries out there are susceptible to bit rot when it comes to documentation. :persecutioncomplex: