Page 1 of 1

Love 0.9.1 returning a "no game" error

Posted: Wed Jan 21, 2015 6:32 pm
by Chesso
I've seen a few other posts on this topic but I didn't understand all the jargon I read so I'm posting to ask for an answer in simple terms.

So, whenever I run main.love (or when I have the format .lua and drag it onto the love.exe) I get a screen which says "no game" with a speech bubble around it. I figure this must be because it cannot find the main file or something but I can't think of a solution.

The love files are at "C:\Users\mark\Desktop\LOVE2D\love2d"

And the game files are in "C:\Users\mark\Desktop\LOVE2D\love2d\gameprojects\learning"

The main.love file's code is:

Code: Select all

function love.load()
	love.graphics.GetBackgroundColor(255,255,255)
end

function love.update(dt)
	
end

function love.draw()

end
and the configuration file which is called conf.lua, the code is:

Code: Select all

function love.conf(t)
	t.title = "Game"
	t.screen.width = 1000
	t.screen.height = 750
end
The code is copied almost word for word apart from the title, and the screen sizes.

If you have a solution could this please be explained with simple words as I'm new to the concepts of programming.
Thank you.

Re: Love 0.9.1 returning a "no game" error

Posted: Wed Jan 21, 2015 7:13 pm
by Doctory
first off:

Code: Select all

love.graphics.GetBackgroundColor(255, 255, 255)
should be:

Code: Select all

love.graphics.setBackgroundColor(255, 255, 255)
(there is no getBackgroundColor so this is what i assumed you want)
it seems like you didnt package it correctly.
do the following:
make a new ZIP archive. IT MUST BE ZIP!
drag all of your game files into the zip. main.lua must be in the root of the ZIP file. (not in any folders)
rename it from .zip to .love
run it.

Re: Love 0.9.1 returning a "no game" error

Posted: Wed Jan 21, 2015 7:39 pm
by Chesso
Thanks, seemed to do the trick for me, you're a life saver :awesome:

Re: Love 0.9.1 returning a "no game" error

Posted: Thu Jan 22, 2015 1:05 am
by Robin
You can also drag the game folder (C:\Users\mark\Desktop\LOVE2D\love2d\gameprojects\learning) onto the love.exe, that way you don't have to make a .love every time you change something.

Re: Love 0.9.1 returning a "no game" error

Posted: Thu Jan 22, 2015 2:58 am
by Positive07
Doctory wrote:there is no getBackgroundColor so this is what i assumed you want
Actually:
[wiki]love.graphics.getBackgroundColor[/wiki]

Re: Love 0.9.1 returning a "no game" error

Posted: Thu Jan 22, 2015 5:58 am
by AlexCalv
Positive07 wrote:
Doctory wrote:there is no getBackgroundColor so this is what i assumed you want
Actually:
[wiki]love.graphics.getBackgroundColor[/wiki]
I think he's saying that there's no background color to get so he's trying to set it instead of get it.

Re: Love 0.9.1 returning a "no game" error

Posted: Thu Jan 22, 2015 8:49 pm
by Positive07
Of course it makes sense setting it more than getting it, but still you could get it, the function would return 0,0,0... Just pointing out that MAYBE that is what he wanted... Not the case though, since he is passing arguments to the function but... just saying

Re: Love 0.9.1 returning a "no game" error

Posted: Fri Jan 23, 2015 1:28 am
by Jasoco
In reply to the OP, first off the function names are case sensitive. You capitalized get in getBackgroundColor, which would cause an error if it did run right.

Secondly, the .lua file needs to be named main.lua and be at the top level of the .love file or folder where the conf.lua file is. If it's not in this location it would cause the No Game problem you were/are having.

And yes, providing you spell it correctly and put the main.lua file in the root then all you're going to get is a black screen as getBackgroundColor() is returning values, it's not meant to be on its own. And the get function doesn't do anything with passed arguments. It's a return function, not a send function. get returns while set sends as is standard in all of Löve's callbacks. Call it on its own and nothing will happen since you aren't using its returned values.