bzr branch
http://9ix.org/bzr/ld26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Player = Tile:extend { image = 'data/player1.png', onNew = function(self) end, onStartFrame = function(self) if the.keys:pressed('up') then self.velocity.y = -100 elseif the.keys:pressed('down') then self.velocity.y = 100 else self.velocity.y = 0 end if the.keys:pressed('right') then self.velocity.x = 100 elseif the.keys:pressed('left') then self.velocity.x = -100 else self.velocity.x = 0 end end } |