X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=samples%2Fgames%2Fblokus%2Fblokus.ec;h=6cf8e759b6c0ea3159de2cec7b8cb9f7c01b1918;hb=8ee80ec2b5c2317d48ff1ac4b3a886a5d1bed7aa;hp=049d455c7ff8e08a66b548544d2dfddb6485b287;hpb=6bad27e666389fc889502c26e7474a361f0ed80c;p=sdk diff --git a/samples/games/blokus/blokus.ec b/samples/games/blokus/blokus.ec index 049d455..6cf8e75 100644 --- a/samples/games/blokus/blokus.ec +++ b/samples/games/blokus/blokus.ec @@ -648,9 +648,9 @@ class Blokus : Window Piece * piece = &pieces[selectedPiece]; int w = (direction & 1) ? piece->h : piece->w; int h = (direction & 1) ? piece->w : piece->h; - drag = { offset.x + mx, offset.y + my }; + drag = { offset.x + mx, offset.y + my }; - if(mx - squareDragged.x * squareWidth >= boardStartX - 10 && mx - squareDragged.x * squareWidth < boardStartX + ((boardSize-w)+1) * squareWidth + 10 && + if(mx - squareDragged.x * squareWidth >= boardStartX - 10 && mx - squareDragged.x * squareWidth < boardStartX + ((boardSize-w)+1) * squareWidth + 10 && my - squareDragged.y * squareWidth >= boardStartY - 10 && my - squareDragged.y * squareWidth < boardStartY + ((boardSize-h)+1) * squareWidth + 10) { int x, y; @@ -758,7 +758,7 @@ class Blokus : Window squareDragged = { w-1-y, x }; else squareDragged = { y, h-1-x }; - + offset.x -= squareDragged.x * squareWidth; offset.y -= squareDragged.y * squareWidth; @@ -873,7 +873,7 @@ class Blokus : Window empty.b + lightValue * (full.b - empty.b) }; } - + surface.foreground = aqua; for(c = 0; c <= boardSize; c++) { @@ -1010,7 +1010,7 @@ class Blokus : Window drag.y + y * squareWidth, colorPlayed, gameStarted && gameState.colorTurn == colorPlayed && gameState.validPieces[selectedPiece]); - + if(x == 0 || !PieceBlock(selectedPiece, x-1, y, direction, flip)) { surface.foreground = white;