/spacey

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-05-05 00:41:10 UTC
  • Revision ID: josh@9ix.org-20130505004110-hmcvz9payau6q0io
maxVelocity

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
}
21
21
 
22
22
local velLimit = 600
23
 
SpacePlayer = Tile:extend{
24
 
   image = 'data/ship.png',
 
23
SpacePlayer = Fill:extend{
 
24
   fill = {255,0,0},
 
25
   height = 32,
 
26
   width = 32,
25
27
   maxVelocity = {x=velLimit,y=velLimit},
26
28
   minVelocity = {x=-velLimit, y=-velLimit},
27
29
   onStartFrame = function(self)
33
35
 
34
36
                     self.acceleration.x = dx * 2
35
37
                     self.acceleration.y = dy * 2
36
 
 
37
 
                     --TODO: acceleration limit.  It should at least be proportional (not 16:9)
38
 
                  end,
39
 
   onUpdate = function(self)
40
 
                 self.rotation = math.atan2(self.velocity.y, self.velocity.x)
41
 
              end
 
38
                  end
42
39
}
 
 
b'\\ No newline at end of file'