diff --git a/examples/gameplay/plateform/actors/player.lua b/examples/gameplay/plateform/actors/player.lua index f519d12..0b6010d 100644 --- a/examples/gameplay/plateform/actors/player.lua +++ b/examples/gameplay/plateform/actors/player.lua @@ -24,6 +24,11 @@ function Player:update(dt) self.xsp = 120 end + if self.keys["start"].isPressed then + self.world:switchActivity() + self.scene:flushKeys() + end + self:setDirection(self.xsp) Player.super.update(self, dt) diff --git a/examples/gameplay/plateform/init.lua b/examples/gameplay/plateform/init.lua index 4ab87cc..c72ccfa 100644 --- a/examples/gameplay/plateform/init.lua +++ b/examples/gameplay/plateform/init.lua @@ -39,11 +39,16 @@ function Plateformer:new() end function Plateformer:update(dt) - + if (self.world.isActive == false) and self.sources[1].keys["start"].isPressed then + self.world:switchActivity() + end end function Plateformer:draw() - + if (self.world.isActive == false) then + local w, h = core.screen:getDimensions() + love.graphics.printf("PAUSE", 0, h/2 - 16, w, "center") + end end return Plateformer