Go OOP!

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Go OOP!

Post by Charles256 »

Code: Select all

int main(void)
{
	setup();
	buffering game_screen;
	main_menu my_main_menu(game_screen);
	while(!key[KEY_ESC])
	{
		my_main_menu.render_menu();		
		game_screen.render();
	}
	game_screen.destroy_bitmaps();
    allegro_exit();
	return 0;
}
END_OF_MAIN()
bet ya can't guess what it does :-D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Blow up during compilation?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Where's the OOP in your game loop?
(#10850)
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Looks like a continuous GUI refill loop which I would guess uses the Allegro Game lib ;). The naming suggests a startup menu prior to starting a new game?
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

feyd: despite initial fears, no. :)
arborint: darn you.
reaper: twelve trillion points for guessing the library. :-D If I would have removed the allegro_exit (Which i have done since) you would have been lost! :-D I am abstracting allegro from itself mainly because it's so damn repetetive. I know, harsh, but true. However, you are absolutely correct. It's the main menu prior to starting a new game which I am finally doing now that I can speak allegro. Or at least ernough to attempt this. Who wants in on it?! :-D
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

I do my time in games in a few languages - I used Allegro in a small game a long time back. The KEY_ESC condition was a dead giveaway more than anything - where else in a game does ESC break a refresh loop? ;)
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

darn. I shoulda waited till tonight to post it then because I am removing the key_esc for more traditional methods, i.e. quit game selected, user hit esc then hit quit game,etc. :-D
Post Reply