/spacey

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-05-05 17:28:21 UTC
  • Revision ID: josh@9ix.org-20130505172821-t5ba218dz1pkjois
ignore deploy dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
require 'version'
8
8
require 'player'
 
9
require 'enemy'
 
10
require 'cursor'
 
11
 
 
12
util = {
 
13
   signOf = function(value)
 
14
               if value >= 0 then
 
15
                  return 1
 
16
               else
 
17
                  return -1
 
18
               end
 
19
            end
 
20
}
9
21
 
10
22
GameView = View:extend {
11
23
   onNew = function (self)
22
34
              the.player = SpacePlayer:new{x=400,y=300}
23
35
              self:add(the.player)
24
36
 
 
37
              self:add(Enemy:new{x=400, y=300})
 
38
 
 
39
              self:add(Cursor:new())
 
40
 
25
41
              love.mouse.setGrab(true)
26
 
              --love.mouse.setVisible(false)
 
42
              love.mouse.setVisible(false)
27
43
 
28
44
              --self:loadLayers('data/map.lua')
29
45
              self.focus = the.player