/ld27

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

« back to all changes in this revision

Viewing changes to zoetrope/sprites/tile.lua

  • Committer: Josh C
  • Date: 2013-08-24 03:54:55 UTC
  • Revision ID: josh@9ix.org-20130824035455-upi2mnssckafqxgs
map loading, super basic movement

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                end
55
55
        end,
56
56
 
57
 
        draw = function (self, x, y, map)
 
57
        draw = function (self, x, y)
58
58
                if not self.visible or self.alpha <= 0 then return end
59
59
 
60
60
                x = math.floor(x or self.x)
92
92
                if self.flipX then scaleX = scaleX * -1 end
93
93
                if self.flipY then scaleY = scaleY * -1 end
94
94
 
95
 
    if map then
96
 
       batches = map.spriteBatches
97
 
 
98
 
       if not batches[self.image] then
99
 
          --batches:addBatch(self.image, self._imageObj)
100
 
          local maph, mapw = map:getMapSize()
101
 
          batches[self.image] = love.graphics.newSpriteBatch(self._imageObj, mapw * maph)
102
 
          print('adding new batch')
103
 
       end
104
 
 
105
 
       batches[self.image]:addq(self._quad, x + self.width / 2, y + self.height / 2, self.rotation, scaleX, scaleY, self.width / 2, self.height / 2)
106
 
    else
107
 
 
108
 
       love.graphics.drawq(self._imageObj, self._quad, x + self.width / 2, y + self.height / 2, self.rotation,
109
 
                           scaleX, scaleY, self.width / 2, self.height / 2)
110
 
                end
111
 
 
 
95
                love.graphics.drawq(self._imageObj, self._quad, x + self.width / 2, y + self.height / 2, self.rotation,
 
96
                                                        scaleX, scaleY, self.width / 2, self.height / 2)
 
97
                
112
98
                -- reset color
113
99
                
114
100
                if colored then