[SOLVED] weird libgdx game problem....

Alright well I just started making a game and I have a problem… I made a mainmenu screen but as I load it the render method does not load and it goes back to the main class to finish there which is confusing…
Check out the code here:
Here is the main class for the game: http://pastebin.com/idQ7Fd0D
and here is the main menu class: http://pastebin.com/wYQZMHna
assets class (i dont really think any one will need this but just in case) http://pastebin.com/JWLJA6Ck

Those classes are pretty short so dont get worried about that. If you look at the source code you will notice I put some println’s in every method to see what gets called. here is the output:
AL lib: MMDevApiMsgProc: Unexpected message: 0 assest pre mainmenuscreenend show resize po
that first “AL lib” comes in red but it works with another game with that error showing up so I dont think thats the problem, but does anyone know what that means? And anyway as you can see the mainmenu screen is getting called to but the render isnt… I based this simple game so far on the superjumper example just to help me get started. Any thoughts are appreciated

Its probably because your class, that is extending Game

is @overriding things that it probably shouldn’t be. Or you aren’t calling super

Examine game, and how setScreen and the current functions behave.
It works a little bit differently then when you use the extend applicationlistener approach.

edit: easy fix
in your “public class SideScroller extends Game”
All those ‘blank @override’ methods you have, just delete them all
keep the onCreate though, and it should all start working.
easy fix #2
add super.____(); for each @overriden area, specifically the render area
super.render(); inside your @override public void render()
The others should be super’d as well, or just removed completely until you have something to add.

In the superJumper example, he did @override the render, but he also called super.render();
super allows the overridden code to still execute, in addition to the code you’ve added.

https://github.com/libgdx/libgdx/blob/master/demos/superjumper/superjumper/src/com/badlogicgames/superjumper/SuperJumper.java

Thank you ! the super.render() fixed the problem! many thanks!

Also do you know what this means:
AL lib: MMDevApiMsgProc: Unexpected message: 0
That error always come up now when i run libgdx games… :frowning:

I do not, I haven’t done anything in java in a while now, I hope to be getting back into it.
I think its just part of the libgdx standard output message

Also, it says there are 0 unexpected messages, so that seems like a good thing.
It would be bad to have unexpected messages.
Honestly, I wouldn’t worry about it, especially if everything seems to be working fine.