I'm working on a game, really really reaaaaally simple. It's called "Followers"
and you control a mouse and every third second a new red dot appear on the
screen. If you touch a red dot, you lose. Every second counts as one point,
but my problem is, I don't know how to make a start menu, cause if I write:
function love.load()
screenMenu = love.graphics.newImage("graphics/screens/menu.png")
screenPlay = love.graphics.newImage("graphics/screens/play.png")
buttonStart = love.graphics.newImage("graphics/buttons/start.png")
screen = menu
end
function love.update()
end
function love.draw()
if screen == menu then
love.graphics.draw(screenMenu, 0, 0)
else love.graphics.clear(screenMenu)
end
if screen == play then
love.graphics.draw(screenPlay, 0, 0)
else love.graphics.clear(screenPlay)
end
if screen == menu then
love.graphics.draw(buttonStart, 400, 300)
else love.graphics.clear(buttonStart)
end
end
my game screen is white (because screenPlay is white) and whatever I do, it remains
white! HELP!
HELP!
Re: HELP!
Probably you suffer of the PO2 Syndrome, like me
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: HELP!
Hey,
actually you don't need the love.graphics.clear()-function. The screen is cleared automaticly on every cycle just before your love.draw(...) is called.
So just simple draw your stuff and you're fine...
So something like that:
After all you need some code in the love.update() section to change the status of the screen-variable.
actually you don't need the love.graphics.clear()-function. The screen is cleared automaticly on every cycle just before your love.draw(...) is called.
So just simple draw your stuff and you're fine...
So something like that:
Code: Select all
function love.draw()
if screen == menu then
love.graphics.draw(screenMenu, 0, 0)
elseif screen == play then
love.graphics.draw(screenPlay, 0, 0)
elseif screen == menu then
love.graphics.draw(buttonStart, 400, 300)
end
end
Re: HELP!
And, just noticed, you shouldn't write 'if screen == menu' 'cause menu and play are nil; you should write 'if screen == "menu' or something like that
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: HELP!
Isn't PO2 supposed to be dead now that 0.8.0 is out?Nixola wrote:Probably you suffer of the PO2 Syndrome, like me
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: HELP!
Yes, I believe so.Jasoco wrote:Isn't PO2 supposed to be dead now that 0.8.0 is out?Nixola wrote:Probably you suffer of the PO2 Syndrome, like me
Re: HELP!
Yeah, it should... But how can we know he's not using 0.7.2? Wait... Adamantos, what OVE version are you using?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Who is online
Users browsing this forum: Bing [Bot] and 5 guests