Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Oi. Need help in C++ with setting up room states.[ FIXED ]
- By Maverick Date 2009-06-07 17:47
I've looked at many Ruby examples of getting the room states ( room states = gosu's windows  ) to work properly but I don't know enough Ruby apparently to port it over to C++.
I'm trying to do something like:

roomHandler->thisRoom = new titleScreen ( gameName );

But actually getting roomHandler and thisRoom set up properly to do this is giving me a headache.
I mean, I kind of got it, but the way I have it only works when that "room" is closed via the window X button and then the right right comes up. The ruby examples simply show the room state being set to the wanted window and nothing more.

Any help?

EDIT: My title should by "Gosu Newb" :p
- By jlnr (dev) Date 2009-06-07 20:05
If you are speaking of states as in benko's game, then the states are *not* Gosu::Windows, they are just objects which implement the same callbacks (draw, update, button_down, button_up), and the object forwards these calls to the current state. I hope I'm not answering the wrong question :)
- By Maverick Date 2009-06-07 20:24
I was referring to how you did the states in Zombie Socarrr. You had the state room derived from the class Gosu::Window I believe.
- By jlnr (dev) Date 2009-06-07 20:55
There is only one window class in Zombie Soccarrr, StateWindow. It delegates all callbacks either to a Game or TitleScreen state. State itself is not derived from anything and exists just for the sake of convenience, it provides empty methods for all callbacks :)
- By Maverick Date 2009-06-07 21:45
Ok then. I'll try recoding it again and tell you my results. :p
- By Maverick Date 2009-06-08 02:48
I finally got it working. The main problem was that I was trying to take a game framework that I made for another library and trying to port it for Gosu. I thought Gosu and this library would be the same in a sense but I was a bit off. :D

thanks again.
Up Topic Gosu / Gosu Exchange / Oi. Need help in C++ with setting up room states.[ FIXED ]

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill