examples/moveplayer: test 2 players

This commit is contained in:
Kazhnuz 2019-04-11 19:18:51 +02:00
parent a81ac5b819
commit f61cb21d58
2 changed files with 19 additions and 4 deletions

View File

@ -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"
}
}
},
}

View File

@ -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)