/zoeplat

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-03-05 22:06:58 UTC
  • Revision ID: josh@9ix.org-20130305220658-92yptjso9z57vzly
use zoetrope 288:a82a08660477 2013-02-23

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
                     -- this is all in startframe so it happens before
14
14
                     -- physics calc at beginning of update
15
15
 
16
 
                 self.velocity.x = 0
17
 
                 self.acceleration.y = 800
18
 
 
19
 
                 if the.keys:pressed('left') then
20
 
                    self.velocity.x = -200
21
 
                 elseif the.keys:pressed('right') then
22
 
                    self.velocity.x = 200
23
 
                 end
24
 
 
25
 
                 if the.keys:justPressed('up') then
26
 
                    self.velocity.y = -400
27
 
                 end
28
 
              end,
 
16
                     self.velocity.x = 0
 
17
                     self.acceleration.y = 800
 
18
 
 
19
                     if the.keys:pressed('left') then
 
20
                        self.velocity.x = -200
 
21
                     elseif the.keys:pressed('right') then
 
22
                        self.velocity.x = 200
 
23
                     end
 
24
 
 
25
                     if the.keys:justPressed('up') then
 
26
                        self.velocity.y = -400
 
27
                     end
 
28
                  end,
29
29
   onUpdate = function (self)
30
30
                 -- this is called after physics, so this makes sense here
31
31
                 the.view.map:subdisplace(self)