for(c = 0; c<Letters::blank; c++)
{
list.AddRow().SetData(field, c);
- }
+ }
}
}
char ch = (char)a + 'A';
surface.SetForeground(blank ? gray : black);
surface.TextFont(letterFont.font);
- surface.WriteText(x + 5, y, &ch, 1);
+ surface.WriteText(x + 5, y, &ch, 1);
if(!blank)
{
if(boardLetters[cy][cx] == empty)
{
- surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1);
+ surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1);
surface.SetForeground(black);
if(cx == 7 && cy == 7)
{
else if(boardLetters[cy][cx] == empty)
{
surface.SetBackground(burlyWood);
- surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1);
- }
+ surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1);
+ }
}
void OnRedraw(Surface surface)
surface.HLine(BoardX, BoardX + TileSize * 15, BoardY + y * TileSize);
surface.HLine(BoardX, BoardX + TileSize * 15, BoardY + y * TileSize+1);
}
-
+
for(x = 0; x<16; x++)
{
surface.VLine(BoardY + 0, BoardY + TileSize * 15, BoardX + x * TileSize);
{
DrawSquare(surface, x, y);
}
-
+
for(c = 0; c<numLetters; c++)
{
if(dragging && c == dragLetter)
// Picking Letters on the board
if(gameStarted && turn == playerID)
{
- if(mx > BoardX && mx < BoardX + TileSize * 15 &&
+ if(mx > BoardX && mx < BoardX + TileSize * 15 &&
my > BoardY && my < BoardY + TileSize * 15)
{
int x = (mx - BoardX) / TileSize;
blankValues[y][x] = empty;
numLetters++;
dragging = true;
-
+
dragY = my;
dragPos = -1;
Capture();
numLetters++;
dragging = true;
-
+
dragY = my;
dragPos = -1;
Capture();
else if(posA > posB)
return 1;
else
- return 0;
+ return 0;
}
bool OnMouseMove(int mx, int my, Modifiers mods)
for(c = 0; c<numLetters; c++)
ordered[c] = c;
-
+
if(y < TileSize && y > -TileSize && moveX + TileSize >= 0 && moveX <= TrayWidth)
{
qsort(ordered, numLetters, sizeof(int), ComparePositions);
memmove(ordered + dragPos + 1, ordered + dragPos, (pos - dragPos) * sizeof(int));
ordered[dragPos] = dragLetter;
}
-
+
ordered[dragPos] = dragLetter;
ordered[pos] = oldValue;
}
if(out && c != numLetters)
collision = true;
}
-
+
if(moveX >= lastX || collision)
{
int end;
-
+
for(c = 0; c<numLetters; c++)
{
if(ordered[c] == dragLetter)
break;
}
}
-
+
end = moveX + TileSize;
for(; c < numLetters; c++)
}
end = ((ordered[c] == dragLetter) ? moveX : positions[ordered[c]]) + TileSize;
}
-
+
// RIGHT LIMIT
end = TrayWidth;
for(c = numLetters-1; c>= 0; c--)
// Dropping On the board
if(gameStarted && turn == playerID)
{
- if(mx > BoardX && mx < BoardX + TileSize * 15 &&
+ if(mx > BoardX && mx < BoardX + TileSize * 15 &&
my > BoardY && my < BoardY + TileSize * 15)
{
x = (mx - BoardX) / TileSize;
int end;
int ordered[7];
int c;
-
+
for(c = 0; c<numLetters; c++)
ordered[c] = c;
qsort(ordered, numLetters, sizeof(int), ComparePositions);
positions[ordered[c]] = end;
end = positions[ordered[c]] + TileSize;
}
-
+
// RIGHT LIMIT
end = TrayWidth;
for(c = numLetters-1; c>= 0; c--)
{
dragging = false;
ReleaseCapture();
-
+
if(my > ThrowHeight)
{
throwLetters[numThrowLetters++] = letters[dragLetter];
// Dropping Letters on the board
if(gameStarted && turn == playerID)
{
- if(mx > BoardX && mx < BoardX + TileSize * 15 &&
+ if(mx > BoardX && mx < BoardX + TileSize * 15 &&
my > BoardY && my < BoardY + TileSize * 15)
{
int x = (mx - BoardX) / TileSize;
}
DataField scoreFields[MaxPlayers];
-
- Button playBtn
+
+ Button playBtn
{
this, text = "Play", bevel = false, position = { 520, 540 };
font = { "Arial", 20, true };
opacity = 0; drawBehind = true;
-
+
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
if(!numThrowLetters && gameStarted && turn == playerID)
this, text = "Throw / Pass", bevel = false, position = { 430, 622 };
font = { "Arial", 20, true };
opacity = 0; drawBehind = true;
-
+
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
bool placed = false;
this, text = "Connect", bevel = false, position = { 520, 122 };
font = { "Arial", 20, true };
opacity = 0; drawBehind = true;
-
+
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
if(!server)
int y = move.tiles[c].y;
scrabble.boardLetters[y][x] = move.tiles[c].letter;
scrabble.blankValues[y][x] = move.tiles[c].blankValue;
- }
+ }
scrabble.playerScores[move.player] += move.score;
scrabble.scores.AddRow().SetData(scrabble.scoreFields[move.player], scrabble.playerScores[move.player]);
scrabble.Update(null);
memcpy(scrabble.lastBoard, scrabble.boardLetters, sizeof(scrabble.lastBoard));
-
+
do
{
scrabble.turn++;
this, text = "Start", bevel = false, position = { 520, 222 };
font = { "Arial", 20, true };
opacity = 0; drawBehind = true;
-
+
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
if(scrabbleGame)
this, text = "Host (Français)", bevel = false, position = { 520, 322 };
font = { "Arial", 16, true };
opacity = 0; drawBehind = true;
-
+
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
if(!scrabbleGame || !scrabbleGame.gameStarted)
this, text = "Host (English)", bevel = false, position = { 520, 362 };
font = { "Arial", 16, true };
opacity = 0; drawBehind = true;
-
+
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
if(!scrabbleGame || !scrabbleGame.gameStarted)