I dont know how many of you know C but i will try to explain it simple:
How can i create different pages on screen in LOVE
(e.g. INTRO then MENUE then GAME then PAUSE etc)
in C its kinda easy, You just have to create 2 different .c files (e.g. main.c / menu.c / play.c etc)
then include them all together (where needed^^) and mark a key like this to blit it on "screen":
[...]event.key.keysym.sym){
case SDLK_p:
options(screen);
break;
} [...]
then same stuff if you wanna go back...
So is there any way to do this in love2d?
thx
PS: i tried to make a splashIntro as a big "fat" function in splashIntro.lua then include it in the main.lua
(e.g.
--main.lua
require("splashIntro")
function love.load()
splashIntro()
[...]
end
[...]
)
but it crashes and says me some weird stuff, idk... """
and in any case i dont even know how to FreeSurface it...
For anyone that doesn't like bright green on baby blue:
vt007 wrote:PS: i tried to make a splashIntro as a big "fat" function in splashIntro.lua then include it in the main.lua
(e.g.
--main.lua
require("splashIntro")
function love.load()
splashIntro()
[...]
end
[...]
)
but it crashes and says me some weird stuff, idk... """
and in any case i dont even know how to FreeSurface it...
Missing Sentinel Software | Twitter FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
What you're asking for is some sort of game state management.
There are plenty of ways to do it (mostly involving some OOP solution).
Here is how I do mine: https://bitbucket.org/dannyfritz/blank-love/src