CSVPlatformer and some questions

Hello everybody.

I just started to use JME and I created my first simple game:

CSVPlatformer, a 3D platformer that can use csv to create levels.

CSVPlatformer UML

During the development I have had some doubts:

  1. I am overusing the AppStates? Should I put the PlayerState and LevelState together in one AppState like GameState?

  2. How I should access outside objects? Like the PhysicsSpace, I set it as a field in the main class and made that into a singleton so I can access the static main instace and use getters. But I can also put a reference to the PhysicsSpace in each class in which is needed.

  3. I am using Minie CharacterControl and when I move the player in some direction the model moves a bit from the center. Can I change this?



I haven’t looked at the code… but in general, more app states is often better than too few. PlayerState and LevelState sound find to me. (For reference, right now Mythruna has 60 different app states in its own codebase and probably sucks in 10 or so from other libraries.)

It’s contextual… but note that if you extended BaseAppState then it’s trivial to look up sibling app states with the getState() method. initialize() can be a good place to fixup these sort of external references but sometimes for simple things I just use getState() where I need it.


Thanks for your response @pspeed. I didn’t was aware of the getState() methods in the BaseAppState :sweat_smile:

I’m trying to not write to much spaghetti code :laughing:

1 Like