1
1
Player = Tile:extend {
2
image = 'data/player1.png',
2
image = 'data/player-null.png',
3
3
onNew = function(self)
6
self.movementScale = self.height / 32
7
--print(self.movementScale)
9
--self.scale = self.scaleHeight / self.height
10
--self.width = self.height * .826
11
--self.width = self.width * self.scale
5
14
onStartFrame = function(self)
15
local ms = self.movementScale
16
if DEBUG and the.console.visible then
6
20
if the.keys:pressed('up') then
21
self.velocity.y = -100 * ms
8
22
elseif the.keys:pressed('down') then
23
self.velocity.y = 100 * ms
11
25
self.velocity.y = 0
14
28
if the.keys:pressed('right') then
29
self.velocity.x = 100 * ms
16
30
elseif the.keys:pressed('left') then
17
self.velocity.x = -100
31
self.velocity.x = -100 * ms
19
33
self.velocity.x = 0
36
onUpdate = function(self, dt)
37
self:collide(the.view)
39
onEndFrame = function(self)
40
if self.y < self.minY then
43
if self.y > self.maxY then
b'\\ No newline at end of file'