fixed
This commit is contained in:
parent
b4905845e6
commit
d5a60336f5
3 changed files with 28 additions and 13 deletions
1
main.lua
1
main.lua
|
|
@ -11,7 +11,6 @@ function love.load()
|
|||
|
||||
loadSprites()
|
||||
|
||||
|
||||
inputTimer = Timer.new()
|
||||
player = Player:new(2, 1, "green")
|
||||
end
|
||||
|
|
|
|||
16
player.lua
16
player.lua
|
|
@ -1,23 +1,17 @@
|
|||
require "entity"
|
||||
|
||||
Player = class("Player")
|
||||
Player = class("Player", Entity)
|
||||
|
||||
function Player:initialize(x, y, color)
|
||||
|
||||
local entityTable = {
|
||||
Entity.initialize(self, {
|
||||
x = x,
|
||||
y = y,
|
||||
sizeX = 1,
|
||||
sizeY = 1,
|
||||
sizeX = 3,
|
||||
sizeY = 3,
|
||||
color = color,
|
||||
collision = "none" --player can't push other player
|
||||
}
|
||||
|
||||
Entity.initialize(self, entityTable)
|
||||
--need to probably get rid of middleclass
|
||||
--and roll yr own for default method inheritance
|
||||
self.getDrawPos = Entity.getDrawPos
|
||||
self.getGridPos = Entity.getGridPos
|
||||
})
|
||||
|
||||
self.sprite = playerSprite
|
||||
end
|
||||
|
|
|
|||
24
room.lua
24
room.lua
|
|
@ -1,6 +1,14 @@
|
|||
Room = class("Room")
|
||||
require "player"
|
||||
|
||||
function Room:initialize()
|
||||
function Room:initialize(t)
|
||||
self.exits = t.exits
|
||||
self.name = t.name
|
||||
self.player = {}
|
||||
|
||||
for color, coords in ipairs(t.playerColors) do
|
||||
self.player[color] = Player:new(coords.x, coords.y, color)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -11,3 +19,17 @@ end
|
|||
function Room:update()
|
||||
|
||||
end
|
||||
|
||||
function Room:tick()
|
||||
self:nextRoomCheck()
|
||||
end
|
||||
|
||||
function Room:nextRoomCheck()
|
||||
|
||||
end
|
||||
|
||||
function nextRoom()
|
||||
-- currentRoom = Room:new{
|
||||
|
||||
-- }
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue