/ld26

To get this branch, use:
bzr branch http://9ix.org/bzr/ld26

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-04-27 17:06:27 UTC
  • Revision ID: josh@9ix.org-20130427170627-tz6h157jbi708yke
art

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Player = Tile:extend {
2
 
   image = 'data/player-null.png',
3
 
   onNew = function(self)
4
 
              the.player = self
5
 
 
6
 
              self.movementScale = self.height / 32
7
 
 
8
 
              --self.scale = self.scaleHeight / self.height
9
 
              --self.width = self.height * .826
10
 
              --self.width = self.width * self.scale
11
 
              --self:updateQuad()
12
 
           end,
13
 
   onStartFrame = function(self)
14
 
                     if the.keys:pressed('up') then
15
 
                        self.velocity.y = -100
16
 
                     elseif the.keys:pressed('down') then
17
 
                        self.velocity.y = 100
18
 
                     else
19
 
                        self.velocity.y = 0
20
 
                     end
21
 
 
22
 
                     if the.keys:pressed('right') then
23
 
                        self.velocity.x = 100
24
 
                     elseif the.keys:pressed('left') then
25
 
                        self.velocity.x = -100
26
 
                     else
27
 
                        self.velocity.x = 0
28
 
                     end
29
 
                  end
30
 
}
 
 
b'\\ No newline at end of file'