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 

Stopping functions

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



Joined: 19 Oct 2005
Posts: 61

PostPosted: Sun Dec 04, 2005 10:00 am    Post subject: Stopping functions Reply with quote

In my quest to make me game, i have added a menu, and some levels. the problem lies with the menu still being active(i can see it in the background) when i load a level. I am currently using something like this
Code:
if level==1 then
dofile("level1.lua")
elseif level==2 then
dofile("level2.lua")
...etc.
end


when i select my level, it loads the level fine but from a wallpaper error you can see my menu still going on in the background. my concern is that this will make my game slow down. what function should i use instead of "dofile"? or what function should i use to cease the menu from opperating?
Back to top
View user's profile Send private message
Bob535



Joined: 04 Nov 2005
Posts: 56

PostPosted: Mon Dec 05, 2005 3:59 am    Post subject: Reply with quote

When you run another file, just use a break on the first file to terminate the process. I think it works, and that is what I do.
Back to top
View user's profile Send private message
link



Joined: 19 Oct 2005
Posts: 61

PostPosted: Mon Dec 05, 2005 4:45 am    Post subject: Reply with quote

I tried that but all it did was create the menu to be flashing in the background.
Back to top
View user's profile Send private message
JoshDB



Joined: 05 Oct 2005
Posts: 87

PostPosted: Mon Dec 05, 2005 7:13 am    Post subject: Reply with quote

If you call your menu from inside "level1.lua" etc. then just appropriate a variable like [menushow = true/false], then say

Code:
if menushow == true then
dofile("menu.lua")
end
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player 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