From f61cb21d58c3270f5b98cb08c2ad15bdb7741ade Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 11 Apr 2019 19:18:51 +0200 Subject: [PATCH] examples/moveplayer: test 2 players --- datas/inputs.lua | 22 ++++++++++++++++++---- examples/gameplay/moveplayer/init.lua | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/datas/inputs.lua b/datas/inputs.lua index 053f97c..488ee4d 100644 --- a/datas/inputs.lua +++ b/datas/inputs.lua @@ -1,16 +1,30 @@ return { [1] = { + type = "keyboard", + keys = { + ["left"] = "q", + ["right"] = "d", + ["up"] = "z", + ["down"] = "s", + ["A"] = "lshift", + ["B"] = "lctrl", + ["C"] = "w", + ["start"] = "space", + ["select"] = "c" + } + }, + [2] = { type = "keyboard", keys = { ["left"] = "left", ["right"] = "right", ["up"] = "up", ["down"] = "down", - ["A"] = "a", - ["B"] = "z", - ["C"] = "e", + ["A"] = "1", + ["B"] = "2", + ["C"] = "3", ["start"] = "return", ["select"] = "space" } - } + }, } diff --git a/examples/gameplay/moveplayer/init.lua b/examples/gameplay/moveplayer/init.lua index d2326ef..eb04c9b 100644 --- a/examples/gameplay/moveplayer/init.lua +++ b/examples/gameplay/moveplayer/init.lua @@ -32,6 +32,7 @@ function MovePlayer:new() self.world = World(self, "examples.gameplay.moveplayer.actors") self.world:addPlayer(self.world.obj.Player(self.world, 16, 16)) + self.world:addPlayer(self.world.obj.Player(self.world, 424 - 16, 16), 2) end function MovePlayer:update(dt)