2019-04-07 17:00:47 +02:00
|
|
|
local cwd = (...):gsub('%.player$', '') .. "."
|
|
|
|
local Parent = require(cwd .. "parent")
|
|
|
|
local Player = Parent:extend()
|
|
|
|
|
2019-04-29 15:27:40 +02:00
|
|
|
function Player:new(world, x, y, id)
|
2019-04-25 17:54:51 +02:00
|
|
|
Player.super.new(self, world, "player", x, y, 16, 16, true)
|
2019-04-29 21:21:07 +02:00
|
|
|
|
2019-04-07 17:00:47 +02:00
|
|
|
end
|
|
|
|
|
2019-06-13 18:44:13 +02:00
|
|
|
function Player:updateStart(dt)
|
2019-04-28 09:31:37 +02:00
|
|
|
self.xfrc, self.yfrc = 480*3, 480*3
|
2019-04-29 15:27:40 +02:00
|
|
|
|
2019-04-07 22:53:59 +02:00
|
|
|
if self.keys["up"].isDown then
|
2019-04-22 12:02:52 +02:00
|
|
|
self.ysp = -120
|
2019-04-07 17:00:47 +02:00
|
|
|
end
|
2019-04-07 22:53:59 +02:00
|
|
|
if self.keys["down"].isDown then
|
2019-04-22 12:02:52 +02:00
|
|
|
self.ysp = 120
|
2019-04-07 17:00:47 +02:00
|
|
|
end
|
2019-04-07 22:53:59 +02:00
|
|
|
if self.keys["left"].isDown then
|
2019-04-22 12:02:52 +02:00
|
|
|
self.xsp = -120
|
2019-04-07 17:00:47 +02:00
|
|
|
end
|
2019-04-07 22:53:59 +02:00
|
|
|
if self.keys["right"].isDown then
|
2019-04-22 12:02:52 +02:00
|
|
|
self.xsp = 120
|
2019-04-07 17:00:47 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-04-29 15:27:40 +02:00
|
|
|
function Player:draw()
|
|
|
|
Player.super.draw(self)
|
|
|
|
end
|
|
|
|
|
2019-06-13 22:23:23 +02:00
|
|
|
function Player:drawHUD(id)
|
|
|
|
love.graphics.print(id .. " test", 4, 4)
|
|
|
|
end
|
|
|
|
|
2019-04-07 17:00:47 +02:00
|
|
|
return Player
|