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 

My game crashes :/

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



Joined: 13 Apr 2007
Posts: 48

PostPosted: Sun Apr 15, 2007 12:14 am    Post subject: My game crashes :/ Reply with quote

My game crashes after i complete the first level :/.

The code looks like this:

void nextlevel()
{
FREE_OBJECTS();
start_loading_next(level);//level = global variable : holds the current level
}

void gotonext_level()
{
if (LAST_OBJECT < 0) //out of the screen
{
level+=1;
nextlevel();
}

}
void game()
{
gotonext_level();
drawIMGS();
buttons();
collision();
}
int main ()

{

while(!osl_quit)
{
game();
}
clear();
}

Any ideas what's going on?
Back to top
View user's profile Send private message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Sun Apr 15, 2007 9:26 pm    Post subject: Reply with quote

No one cant tell me how to locate the error?
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sun Apr 15, 2007 9:58 pm    Post subject: Reply with quote

You haven't posted nearly enough information.
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Mon Apr 16, 2007 12:04 am    Post subject: Reply with quote

Ok , here's how i load the next level:

When its time to load the next level the program increases the value of the current level counter and calls the function like this:

counter+=1
loadLEVEL(counter);

load level function

First off all , im calling a function that releases all objects from memory. looks like this:

Note: IMAGE_ARRAY = OSL_IMAGE * IMAGE_ARRAY[128];
Quote:

//clear array
for (int temp=0;temp<=arraysize;temp++) if ( IMAGE_ARRAY[temp] ) {
osldeleteimage(IMAGE_ARRAY[tem]);
}
//more code for background etc..


After all this , the program loads the new objects in the array.
And the game freezes...thats all.
Back to top
View user's profile Send private message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Mon Apr 16, 2007 12:17 am    Post subject: Reply with quote

I found it!!!!!!!!!!!!!!!!!!!1111!
Never mind!
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Apr 16, 2007 4:44 am    Post subject: Reply with quote

Sometimes, all it takes is trying to explain the program to someone to debug it. You're going thru the code telling someone how it's SUPPOSED to work when you suddenly realize that snippet of code THERE doesn't match what you're telling the other folks. :)
Back to top
View user's profile Send private message AIM Address
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