Pausing the game when the tutorial's active

This commit is contained in:
theo@manjaro 2022-03-10 09:42:33 +01:00
parent ae51411fb0
commit ad05851b01
3 changed files with 5 additions and 4 deletions

View File

@ -58,7 +58,7 @@ function gen:new(game,x,y,color,grid)
end
function Circle:MouseCallback(x,y,presses)
if self.rect:collidepoint(x,y) then
if not self.grid.tut.showing and self.rect:collidepoint(x,y) then
if self:isMyTurn() then
local c = self.game:findName("Circle")
local i

View File

@ -1,6 +1,6 @@
local gridgen = {}
function gridgen:new(game,x,y,cellsize)
function gridgen:new(game,x,y,cellsize,tut)
local Grid = game.objects.base:new(game,x,y,cellsize*5,cellsize*5)
Grid.cellsize = cellsize
@ -11,6 +11,7 @@ function gridgen:new(game,x,y,cellsize)
Grid.pinkarrows = game:Timer(1)
Grid.bluearrows.loops = -1
Grid.pinkarrows.loops = 1
Grid.tut = tut
Grid.bluearrowsprite = game:newImage("arrows/blue.png")
Grid.pinkarrowsprite = game:newImage("arrows/pink.png")
Grid:register("Grid")

View File

@ -5,10 +5,10 @@ function scenes:main(game)
local cellsize = 44
local x = (game.WIDTH-cellsize*5)/2
local y = (game.HEIGHT-cellsize*5)/2
local grid = game.objects.grid:new(game,x,y,cellsize)
game:summon(grid)
local tut = game.objects.tutorial:new(game,game.WIDTH-25,25)
game:summon(tut)
local grid = game.objects.grid:new(game,x,y,cellsize,tut)
game:summon(grid)
local background = game.objects.background:new(game,game:newImage("pattern.png"),30,15)
game:summon(background)
local background = game.objects.background:new(game,game:newImage("pattern2.png"),30,-15)