9
image = 'data/player.png',
10
onNew = function (self)
13
onUpdate = function (self)
16
if self.velocity.y >= TERM_VEL then
17
self.velocity.y = TERM_VEL
18
self.acceleration.y = 0
20
self.acceleration.y = 800
23
if the.keys:pressed('left') then
24
self.velocity.x = -200
25
elseif the.keys:pressed('right') then
29
if the.keys:justPressed('up') then
30
self.velocity.y = -400
36
GameView = View:extend {
37
onNew = function (self)
38
self:loadLayers('data/map.lua')
39
self.focus = the.player
40
self:clampTo(self.map)
43
onEndFrame = function (self, dt)
44
self.map:subdisplace(the.player)
49
onRun = function (self)
50
self.view = GameView:new()
52
onUpdate = function (self, dt)
53
if the.keys:justPressed('escape') then
b'\\ No newline at end of file'