From b74be06d2624c094a1aad25b35d94c71f3f11fd1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 7 Apr 2019 17:03:18 +0200 Subject: [PATCH] modules/world: init fake keys for every actor Only the "player object" will get the real inputs --- gamecore/modules/world/actors/actor2D.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index 5211215..f987bad 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -8,9 +8,14 @@ function Actor2D:new(world, type, x, y, w, h) self.h = h or 0 self.type = type or "" + self:initKeys() self:register() end +function Actor2D:initKeys() + self.keys = core.input.fakekeys +end + function Actor2D:register() self.world:registerActor(self) end