Is there any best way to create pause game feature??
Posted: Sun Aug 07, 2022 3:38 am
Hello everyone,
Is there any simple way to create pause game feature??
my way:
when my game has more object
I need to add more
Is there any best way to create pause game feature??
thank you very much
Is there any simple way to create pause game feature??
my way:
Code: Select all
function love.load()
pause = false
number = 0
end
function love.update(dt)
function love.keypressed(key, unicode)
if key == 'p' then pause = not pause end
end
if pause == false then
-- do something when the game is paused
number = number + 1
end
end
function love.draw()
if pause then love.graphics.print("Game is paused",0,0) else
love.graphics.print("Game is running",0,0) end
love.graphics.print(number,400,300)
end
I need to add more
Code: Select all
if pause then
thank you very much