fix(levels): use the new reference for key handling

This commit is contained in:
Kazhnuz 2019-06-16 17:49:45 +02:00
parent 7d3de10a97
commit 0566eb4041
3 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- **worldmap:** use gamecore 0.5.0-style key handling
- **levels:** use gamecore 0.5.0-style key handling
## Imperium-Porcorum 0.0.1
- Initial pre-alpha released based on source status before starting port to gamecore 0.5.0

View File

@ -65,7 +65,7 @@ end
-- Physics and function called every game update
function Player:update(dt)
self.keys = self.level.keys
self.keys = self.level.sources[1].keys
self.level.assets.sprites[self.stats.race]:setCustomSpeed(math.abs(self.xsp / 60))
self:actionMove(dt)

View File

@ -91,13 +91,14 @@ end
-- Update the level
function Level:update(dt)
local keys = self.sources[1].keys
if (self.pause == false) then
self.playermanager:update(dt)
self.world:update(dt)
self.camera:update(dt)
end
if self.keys["start"].isPressed then
if keys["start"].isPressed then
self.pause = (self.pause == false)
end
end