forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Main game loop (will be a noob error i'm afraid...)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Thu Dec 28, 2006 8:59 am    Post subject: Main game loop (will be a noob error i'm afraid...) Reply with quote

Hi folks,

my main gameloop does not what i expect it to do:

Code:
   void GameLoop() {


      
      while(1) {
         if (GameMainMenu() == 9) {break;}
         else {
            //result = GameMain();

            if (GameMain() == 1) {
               if (bClearThemes == FALSE) {
                  UnloadGameGraphics();
                  bClearThemes = TRUE;
               }   
               GameOver();
            }               // runs the game
            else {
               sceGuTerm();
               sceKernelExitGame();
            }
         }
      }
      return;
   }


the first time we enter the loop all is well. When i return from the mainmenu the game starts. When i'm gameover or exit the game i go to the gameover screen. when i leave the gameover screen i go to the mainmenu again. This mainmenu renders correctly and all menuitems work without error. except for the exit game button whichs should exit to the xmb but now goes to the gameoverscreen. The new game also goes directly to the gameover screen. At the very first line of code in the newgame i let the psp pause until i press the X button. This works the first time i run the new game however when return to the mainmenu after that it just goes directly to the gameover screen without going to the gamemain function :S

any idea what is causing this? any ideas and suggestions are appreciated even if someone is not sure.

greets ghoti
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Thu Dec 28, 2006 7:53 pm    Post subject: Reply with quote

i have solved it, it was an memory error :S
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group