Creating new instances

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.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Creating new instances

Post 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 ?
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

Re: Creating new instances

Post by Miken1 »

Yes exactly but I only get a grey screen, also, nothing happens when I press E.
Attachments
3cLKjU5.png
3cLKjU5.png (305.48 KiB) Viewed 272 times
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Creating new instances

Post 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.
Attachments
Platformer.love
(9.35 KiB) Downloaded 74 times
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

Re: Creating new instances

Post by Miken1 »

Strange, it's working now but rest of my "game" is not drawing! like the player and stuff
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Creating new instances

Post 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
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

Re: Creating new instances

Post 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?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Creating new instances

Post 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.
When I write def I mean function.
User avatar
Miken1
Prole
Posts: 42
Joined: Tue Nov 05, 2013 8:35 am
Location: Sweden

Re: Creating new instances

Post by Miken1 »

*Running away*

Thanks!
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 4 guests