Page 1 of 1

My second gameState wont show up...

Posted: Wed Oct 30, 2013 6:24 pm
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-

Re: My second gameState wont show up...

Posted: Thu Oct 31, 2013 8:32 am
by Vandie
guys please , ii really need your help here...

Re: My second gameState wont show up...

Posted: Thu Oct 31, 2013 9:18 am
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

Re: My second gameState wont show up...

Posted: Thu Oct 31, 2013 12:36 pm
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.

Re: My second gameState wont show up...

Posted: Mon Nov 04, 2013 11:31 am
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.