My second gameState wont show up...

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
User avatar
Vandie
Prole
Posts: 12
Joined: Sun Sep 08, 2013 8:22 pm

My second gameState wont show up...

Post by Vandie »

Im not sure what else to say , its kinda self explanatory...

my .love file is available here (attachments wont work)
-removed by me as no longer needed-
Last edited by Vandie on Thu Oct 31, 2013 12:44 pm, edited 1 time in total.

Code: Select all

Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...

Code: Select all

How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
User avatar
Vandie
Prole
Posts: 12
Joined: Sun Sep 08, 2013 8:22 pm

Re: My second gameState wont show up...

Post by Vandie »

guys please , ii really need your help here...

Code: Select all

Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...

Code: Select all

How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: My second gameState wont show up...

Post by micha »

Hi,

bumping your topic after waiting for one day is considered impolite here. Please be a bit more patient in the future. And by the way you can upload .love files directly in the forum post.
To get feedback more quickly next time, try to formulate the problem you face more precisely. In this case, your description was long enough to understand the problem, but only after I looked into your code. I personally usually try to estimate how much effort it would be to help people on the forum, before I even download their code. Hopefully that helps you get feedback more quickly.

Here is the anser:
The problem is that you define the function love.update in the wrong places. In your main.lua you should have a function called love.update. And in all other files you have, you may have update functions but they have to have different names. So in cLogo.lua you should call it, e.g. clogo.update(dt) ...
Then the main update function becomes

Code: Select all

function love.update(dt)
    if gameState == 'intro' then
        cLogo.update(dt)
    elseif gameState == 'L2d' then
        L2dIntro.update(dt)
    end
end
User avatar
Vandie
Prole
Posts: 12
Joined: Sun Sep 08, 2013 8:22 pm

Re: My second gameState wont show up...

Post by Vandie »

Sorry, Normally i would wait but i have adeadline to have this bit finnished by (i know its a bad excuse0 but thats alll i got)

anyway thanks for the help, i keep struggeling to finnish said section and i couldn't get it to work.

Code: Select all

Dear Math, please grow up and solve your own problems, I'm tired of solving them for you...
Quote my 9 year old brother...

Code: Select all

How can you make sure you never miss your target? Shoot first, and whatever you hit, call it the target.
Quote My dad...
User avatar
BozoDel
Party member
Posts: 164
Joined: Fri Nov 01, 2013 10:28 pm

Re: My second gameState wont show up...

Post by BozoDel »

There's also another way to do it, similar to the examples. Whenever you load a new "scene", it overrides love.update and love.draw. Then, when you get back, you override them again.

Though doing as suggested by micha seems cleaner.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], Bondrusiek and 2 guests