Player = Tile:extend { image = 'data/player-null.png', minY = 0, maxY = 600, canMove = true, onNew = function(self) the.player = self self.movementScale = self.height / 32 --print(self.movementScale) --self.scale = self.scaleHeight / self.height --self.width = self.height * .826 --self.width = self.width * self.scale --self:updateQuad() end, onStartFrame = function(self) local ms = self.movementScale if DEBUG and the.console.visible then ms = ms * 4 end if self.canMove then if the.keys:pressed('up') then self.velocity.y = -100 * ms elseif the.keys:pressed('down') then self.velocity.y = 100 * ms else self.velocity.y = 0 end if the.keys:pressed('right') then self.velocity.x = 100 * ms elseif the.keys:pressed('left') then self.velocity.x = -100 * ms else self.velocity.x = 0 end end end, onUpdate = function(self, dt) self:collide(the.view) end, onEndFrame = function(self) if self.y < self.minY then self.y = self.minY end if self.y > self.maxY then self.y = self.maxY end end }