Love 0.9.1 returning a "no game" error

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
Chesso
Prole
Posts: 2
Joined: Wed Jan 21, 2015 6:15 pm

Love 0.9.1 returning a "no game" error

Post 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.
User avatar
Doctory
Party member
Posts: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: Love 0.9.1 returning a "no game" error

Post 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.
Chesso
Prole
Posts: 2
Joined: Wed Jan 21, 2015 6:15 pm

Re: Love 0.9.1 returning a "no game" error

Post by Chesso »

Thanks, seemed to do the trick for me, you're a life saver :awesome:
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Love 0.9.1 returning a "no game" error

Post 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.
Help us help you: attach a .love.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Love 0.9.1 returning a "no game" error

Post by Positive07 »

Doctory wrote:there is no getBackgroundColor so this is what i assumed you want
Actually:
[wiki]love.graphics.getBackgroundColor[/wiki]
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
AlexCalv
Prole
Posts: 49
Joined: Fri Aug 08, 2014 7:12 pm
Contact:

Re: Love 0.9.1 returning a "no game" error

Post 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.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Love 0.9.1 returning a "no game" error

Post 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
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Love 0.9.1 returning a "no game" error

Post 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest