I haven't been able to improve my C++ very much lately and resulted to trying to learn allegro, and eventually when I am capable of it switching to SDL & OpenGL
#include <allegro.h>
void mainMenu();
void playGame();
int gamemode;
int main()
{
allegro_init();
install_keyboard();
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
clear_to_color(screen, makecol(100, 224, 100));
set_color_depth(32);
gamemode = 1;
do{
switch(gamemode)
{
case 0:
playGame();
textout_ex(screen,
font,
"hello world",
20,
30,
makecol(255,0,0),
-1);
break;
case 1:
mainMenu();
break;
}
}while(gamemode != 2);
}
END_OF_MAIN();
void mainMenu()
{
BITMAP *newgame, *quit;
newgame = load_bitmap("newgame.bmp", NULL);
quit = load_bitmap("quit.bmp", NULL);
blit(newgame, screen, 0, 0, 0, 0, 230, 60);
blit(quit, screen, 0, 0, 0, 60, 230, 60);
int choice;
choice = 0;
int choicechosen;
/* while(!key[KEY_ESC])
{
do{
if(key[KEY_S])choice++;
else if(key[KEY_W])choice--;
while(choice >= 3)
{
choice--;
}
while(choice <= 0)
{
choice++;
}
switch(choice)
{
case 1:
newgame = load_bitmap("newgamec.bmp", NULL);
quit = load_bitmap("quit.bmp", NULL);
blit(newgame, screen, 0, 0, 0, 0, 230, 60);
blit(quit, screen, 0, 0, 0, 60, 230, 60);
break;
case 2:
quit = load_bitmap("quitc.bmp", NULL);
newgame = load_bitmap("newgame.bmp", NULL);
blit(newgame, screen, 0, 0, 0, 0, 230, 60);
blit(quit, screen, 0, 0, 0, 60, 230, 60);
break;
if(key[KEY_ENTER])
{
choicechosen = choice;
destroy_bitmap(newgame);
destroy_bitmap(quit);
}
if(choicechosen == 1)
{
gamemode = 0;
}
rest(5);
}while(choicechosen != 2);
gamemode == choicechosen;
if(choicechosen == 2)
{
exit(1);
}
}
} */
void playGame()
{
}
Edited by Jdfskitz, 03 September 2012 - 01:57 PM.






