Proper win when circles can not move
This commit is contained in:
parent
8b04842eeb
commit
d1d9fb006a
2
game.lua
2
game.lua
@ -224,7 +224,7 @@ end
|
||||
function Game:MouseCallback(x,y,presses)
|
||||
local i
|
||||
for i=1,#self.gameloop do
|
||||
self.gameloop[i]:MouseCallback(x,y,presses)
|
||||
if self.gameloop[i]~=nil then self.gameloop[i]:MouseCallback(x,y,presses) end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -51,11 +51,11 @@ function gridgen:new(game,x,y,cellsize)
|
||||
local i
|
||||
local obj = self.game:findName(color)
|
||||
for i=1,#obj do
|
||||
count = count + #obj[i]:findAvailableMoves()
|
||||
count = count + #obj[i]:findAvailableMoves()
|
||||
end
|
||||
if count==0 then
|
||||
local win = "blue"
|
||||
if self.turn < 2 then win = "pink" end
|
||||
local win = "pink"
|
||||
if self.turn < 2 then win = "blue" end
|
||||
self:endgame(win)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user