player done, old way

This commit is contained in:
0x81c 2015-03-15 15:34:17 -04:00
parent 687939b269
commit 1156564fa2
4 changed files with 184 additions and 103 deletions

View file

@ -7,15 +7,14 @@ Player.static.sounds = {
switchSuccess = love.audio.newSource("sounds/switch_success.wav")
}
function Player:initialize(x, y, activeColors)
function Player:initialize(x, y, color)
Entity.initialize(self, {
x = x,
y = y,
color = "white",
color = color,
collision = "none", --player can't push other player
sprite = playerSprite
})
self.activeColors = activeColors or {"red", "green", "blue"}
end
function Player:setActiveColors(colorArray)
@ -40,11 +39,3 @@ function Player:playSwitchSound(success)
sound:stop()
sound:play()
end
function Player:draw()
for _, color in ipairs(self.activeColors) do
love.graphics.setColor(gColor[color]:set())
local p = self:getDrawPos()
love.graphics.draw(self.sprite, p.x, p.y, 0, drawScale, drawScale)
end
end