/ld28

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-12-14 05:24:01 UTC
  • Revision ID: josh@9ix.org-20131214052401-8b2cma95lsvw7avq
rename NotPlayer to Clone cuz they're clones, and it's way too early 
for a class name like NotPlayer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
require 'version'
8
8
require 'player'
9
 
require 'notplayer'
 
9
require 'clone'
10
10
 
11
11
GameView = View:extend {
12
12
   onNew = function (self)
20
20
              }
21
21
              self:add(the.player)
22
22
 
23
 
              the.notplayers = Group:new()
24
 
              self:add(the.notplayers)
 
23
              the.clones = Group:new()
 
24
              self:add(the.clones)
25
25
              for _ = 1, 14 do
26
 
                 the.notplayers:add(NotPlayer:new {
 
26
                 the.clones:add(Clone:new {
27
27
                                       x = math.random(the.app.width),
28
28
                                       y = math.random(the.app.height),
29
29
                                    })
32
32
   onUpdate = function(self, dt)
33
33
                 if the.player.moved then
34
34
                    -- this should encapsulate
35
 
                    for _, np in ipairs(the.notplayers.sprites) do
 
35
                    for _, np in ipairs(the.clones.sprites) do
36
36
                       np:doMove()
37
37
                    end
38
38