Page 3 of 3

Re: Creating new instances

Posted: Tue Nov 19, 2013 12:22 am
by Roland_Yonaba
Miken1 wrote:Just getting a gray screen, is it working for you?
Are you not supposed to press key "e" to start spawning things ?

Re: Creating new instances

Posted: Tue Nov 19, 2013 7:51 am
by Miken1
Yes exactly but I only get a grey screen, also, nothing happens when I press E.

Re: Creating new instances

Posted: Tue Nov 19, 2013 10:32 am
by Roland_Yonaba
This .love is working fine for me. When pressing "e", it spawns a new object at the location where the mouse is.

Re: Creating new instances

Posted: Tue Nov 19, 2013 3:26 pm
by Miken1
Strange, it's working now but rest of my "game" is not drawing! like the player and stuff

Re: Creating new instances

Posted: Tue Nov 19, 2013 4:25 pm
by Roland_Yonaba
In can see there's nested love.draw callbacks. It shouldn't.

Code: Select all

function love.draw()
  -- some code
  function love.draw()
    -- some other code
  end
  -- some code again
end
Remove the inner love.draw, and it should go well, like this:

Code: Select all

function love.draw()
  -- some code
  -- some other code
  -- some code again
end

Re: Creating new instances

Posted: Tue Nov 19, 2013 4:41 pm
by Miken1
Ah i see, all fixed up now!

This is the last question, promise.

I saw this guy on youtube and he is changing values while the program is running, how?

Re: Creating new instances

Posted: Tue Nov 19, 2013 4:53 pm
by kikito
Miken1 wrote:Ah i see, all fixed up now!

This is the last question, promise.

I saw this guy on youtube and he is changing values while the program is running, how?
That's probably a bit advanced for you at the moment (no offense) but here's my guess.

I'm guessing that he's using [wiki]love.filesystem.getLastModified[/wiki] to detect changes on the file. If the date changes, he reloads the file in a string with [wiki]love.filesystem.read[/wiki] and since it's a shader, he just reapplies the shader. You will not be loading a shader, but lua code, so will probably want to use [wiki]love.filesystem.load[/wiki] instead of read.

Re: Creating new instances

Posted: Tue Nov 19, 2013 5:39 pm
by Miken1
*Running away*

Thanks!