void ram(void) { while(1) { if (!screen_intro()){ setTextColor(0xff,0x00); return; } game.rokets = 3; game.level = 1; game.score = 0; init_game(); screen_level(); while (game.rokets>=0) { ////checkISP(); lcdFill(0x00); check_end(); move_ufo(); move_shot(); move_shots(); move_player(); move_enemy(); draw_score(); draw_ufo(); draw_bunker(); draw_player(); draw_enemy(); draw_shots(); // draw_status(); lcdDisplay(); delayms(12); } if (!screen_gameover()) setTextColor(0xff,0x00); return; } }
void render(void) { Rect r; //Clear the screen glClearColor(1.0, 1.0, 1.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); // // //draw a quad with texture glColor3f(1.0, 1.0, 1.0); //Loop the background double *yOFFsetLevel = &setLevel; double *yOFFsetMountain = &setMountain; if(*yOFFsetLevel <= -(levelImage->width)) *yOFFsetLevel = 0.0; if(*yOFFsetMountain <= -(mountainsImage->width)) *yOFFsetMountain = 0.0; ///////////////////////////////////////////// if (background) { draw_background(); } if (start) { StartMenu(); } perspective(); if(show_ufo) { draw_ufo(); draw_yellow(); } if(white) { draw_white(); } if (lives <= 0) { GameOver(); gameover = 1; if(soundcount == 0) fmod_playsound(1); soundcount++; } glDisable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glDisable(GL_BLEND); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); r.bot = yres - 20; r.left = 10; r.center = 0; unsigned int cref = 0x00ffffff; if(start) { r.bot = yres - 175; r.left = (xres/2) - 80; r.center = 0; unsigned int cref = 0x00000000; //Help menu only show in start ggprint10(&r, 16, cref, "Move Up: UP Arrow Key"); ggprint10(&r, 16, cref, "Move Down: Down Arrow Key"); ggprint10(&r, 16, cref, "Move Left: Left Arrow Key"); ggprint10(&r, 16, cref, "Move Right: Right Arrow Key"); ggprint10(&r, 16, cref, "Punch: Space Key"); } if(show_animal && show_rhino) { //In game menu, only show in game ggprint16(&r, 16, cref, "Lives: %i", lives); ggprint16(&r, 16, cref, "High Score: %i", high_score); if(ufocount) { ggprint16(&r, 16, cref, "UFO Help (Press Enter): %i", ufocount); } } }