i require a menu please ^^

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
vt007
Prole
Posts: 14
Joined: Sun Oct 30, 2011 4:01 am

i require a menu please ^^

Post by vt007 »

Wsup? ^^

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":

Code: Select all

[...]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...
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: i require a menu please ^^

Post by josefnpat »

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
vt007
Prole
Posts: 14
Joined: Sun Oct 30, 2011 4:01 am

Re: i require a menu please ^^

Post by vt007 »

that wasnt important dude ^^"" anyway... thx, i guess, to correct my misstakes ^^
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: i require a menu please ^^

Post by TechnoCat »

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
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: i require a menu please ^^

Post by josefnpat »

vt007 wrote:that wasnt important dude ^^"" anyway... thx, i guess, to correct my misstakes ^^
Actually, it was important, because I could not read it at all. Please stop using the color=#BFFFBF tag.
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
vt007
Prole
Posts: 14
Joined: Sun Oct 30, 2011 4:01 am

Re: i require a menu please ^^

Post by vt007 »

ok i mean, ok ^^ :crazy:
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest