rewritten
This commit is contained in:
parent
3ae6c416e5
commit
286871ca21
5 changed files with 15 additions and 15 deletions
17
room.lua
17
room.lua
|
|
@ -66,7 +66,9 @@ end
|
|||
|
||||
function Room:draw()
|
||||
for color, player in pairs(self.player) do
|
||||
player:draw()
|
||||
if self.activeColors[color] then
|
||||
player:draw()
|
||||
end
|
||||
end
|
||||
for color, entityArray in pairs(self.collideables) do
|
||||
for _, entity in pairs(entityArray) do
|
||||
|
|
@ -79,12 +81,15 @@ function Room:movePlayer(key)
|
|||
|
||||
end
|
||||
|
||||
function Room:switchPlayer(colorToActivate)
|
||||
for color, active in pairs(self.activeColors) do
|
||||
if color == colorToActivate then
|
||||
self:setActiveColor(color, true)
|
||||
function Room:switchPlayerColor(color)
|
||||
print(color)
|
||||
for c, active in pairs(self.activeColors) do
|
||||
if color == "white" then
|
||||
self:setActiveColor(c, true)
|
||||
elseif c == color then
|
||||
self:setActiveColor(c, true)
|
||||
else
|
||||
self:setActiveColor(color, false)
|
||||
self:setActiveColor(c, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue