30 lines
781 B
Plaintext
30 lines
781 B
Plaintext
|
local gen= {}
|
||
|
|
||
|
function gen:new(game,x,y,color,grid)
|
||
|
|
||
|
local Circle = game.objects.base:new(game,x,y,grid.cellsize,grid.cellsize)
|
||
|
Circle.cellsize = grid.cellsize
|
||
|
Circle.grid = grid
|
||
|
Circle.shadowsprite = game:newImage("circles/shadow.png")
|
||
|
Circle.sprites = {game:newImage("circles/regular/"..color..".png"),game:newImage("circles/selected/"..color..".png")}
|
||
|
Circle:register("Circle")
|
||
|
Circle:register(color)
|
||
|
Circle.selected = false
|
||
|
|
||
|
function Circle:step(dt) end
|
||
|
|
||
|
function Circle:draw()
|
||
|
local spriteindex = 1
|
||
|
if self.selected then spriteindex = 2 end
|
||
|
lg.draw(self.sprites[spriteindex],self.rect[1]-self.game.camerax-self.spriteoffx,self.rect[2]-self.game.cameray-self.spriteoffy)
|
||
|
end
|
||
|
|
||
|
function Circle:MouseCallback(x,y,presses)
|
||
|
|
||
|
end
|
||
|
|
||
|
return Circle
|
||
|
end
|
||
|
|
||
|
return gen
|