Domino Game Core Logic Development
Budget: $30 – $250 USD
I'm creating a domino game with :
- **Frontend:** React Native (via Expo), Skia, Reanimated
- **Networking:** Colyseus (WebSocket-based)
- **Backend:** Node.js + Colyseus Server
- **Database/Auth:** Supabase (PostgreSQL, Auth, Storage)
- **Platform:** Mobile (Android/iOS via Expo)
The UI for the game table and tiles is already implemented. What I need now is to add the core logic that handles:
Valid tile placement,
Chain expansion (up/down, with 90° turns if needed),
Number matching,
Collision prevention,
And correct handling of double tiles.
I've documented the full placement rules clearly. Let me know if you're available to help implement this logic.
Complete Rules for Tile Placement – Crossed Domino (Portrait Mode)
1. Starting Setup
Place the first double tile horizontally at the exact center of the play area.
This double tile must be centered and aligned horizontally (landscape orientation).
This tile is the origin point for the domino chain.
2. Chain Expansion Logic
2.1 Primary Direction
The chain must initially expand vertically:
First upward and downward from the center double.
Only one tile can be placed per open end (no side branches at the beginning).
2.2 Turning When Space Runs Out
If vertical expansion reaches the edge of the play area:
The chain must automatically turn 90° (left or right).
Continue growing the chain horizontally while respecting the play zone.
3. Tile Placement Rules
3.1 Number Matching
A tile can only be placed if the number it connects with matches the adjacent open number.
(e.g., 6 must connect to 6, 2 to 2, etc.)
3.2 No Overlapping
Tiles must never overlap with other tiles.
Each tile must occupy its own unique, visible space.
3.3 Stay Inside the Play Area
The entire domino chain must stay within the defined play area boundaries.
If no space is available in the current direction, the chain must turn automatically to continue within bounds.
3.4 Natural Growth ("Snake Movement")
The domino chain must grow like a snake, extending logically in a straight line:
Turn only when necessary to avoid collisions or going out of bounds.
Maintain continuity without sudden branches.
4. Special Rules for Doubles
4.1 Double Tile Placement
When placing a double (e.g., 4-4):
The tile must be placed perpendicular to the chain.
It must be center-aligned with the tile it connects to.
4.2 Connecting to Doubles
When connecting a tile to a double:
If space is available, place the tile in front of the double (up or down).
If there's no space vertically, it's allowed to place the tile to the left or right side of the double, ensuring the number matches.
5. Tile Orientation Rules
Chain Direction Tile Orientation
Expanding Up/Down Vertical (portrait)
Expanding Left/Right Horizontal (landscape)
Tiles must be rotated properly based on the chain’s direction.
6. Spacing Rules
Keep consistent spacing between all tiles.
Ensure tiles are center-aligned when connected, especially when connecting to doubles.
7. Placement Validation Checklist (Automated)
Before placing a tile:
Numbers must match between connecting sides.
No tile may overlap with any existing tile.
Tile must remain inside the play area.
Tile must be correctly rotated based on its direction.
Doubles must be placed perpendicularly and center-aligned.
If the current direction is blocked, a valid 90° turn must be performed automatically.
8. Drag-and-Drop Interaction Logic
The player must be able to drag and drop a tile onto the board.
A tile can only be dropped at a valid open end of the chain, where its number matches the connecting tile.
Dropping a tile in an invalid position must be blocked or rejected.
- **Frontend:** React Native (via Expo), Skia, Reanimated
- **Networking:** Colyseus (WebSocket-based)
- **Backend:** Node.js + Colyseus Server
- **Database/Auth:** Supabase (PostgreSQL, Auth, Storage)
- **Platform:** Mobile (Android/iOS via Expo)
The UI for the game table and tiles is already implemented. What I need now is to add the core logic that handles:
Valid tile placement,
Chain expansion (up/down, with 90° turns if needed),
Number matching,
Collision prevention,
And correct handling of double tiles.
I've documented the full placement rules clearly. Let me know if you're available to help implement this logic.
Complete Rules for Tile Placement – Crossed Domino (Portrait Mode)
1. Starting Setup
Place the first double tile horizontally at the exact center of the play area.
This double tile must be centered and aligned horizontally (landscape orientation).
This tile is the origin point for the domino chain.
2. Chain Expansion Logic
2.1 Primary Direction
The chain must initially expand vertically:
First upward and downward from the center double.
Only one tile can be placed per open end (no side branches at the beginning).
2.2 Turning When Space Runs Out
If vertical expansion reaches the edge of the play area:
The chain must automatically turn 90° (left or right).
Continue growing the chain horizontally while respecting the play zone.
3. Tile Placement Rules
3.1 Number Matching
A tile can only be placed if the number it connects with matches the adjacent open number.
(e.g., 6 must connect to 6, 2 to 2, etc.)
3.2 No Overlapping
Tiles must never overlap with other tiles.
Each tile must occupy its own unique, visible space.
3.3 Stay Inside the Play Area
The entire domino chain must stay within the defined play area boundaries.
If no space is available in the current direction, the chain must turn automatically to continue within bounds.
3.4 Natural Growth ("Snake Movement")
The domino chain must grow like a snake, extending logically in a straight line:
Turn only when necessary to avoid collisions or going out of bounds.
Maintain continuity without sudden branches.
4. Special Rules for Doubles
4.1 Double Tile Placement
When placing a double (e.g., 4-4):
The tile must be placed perpendicular to the chain.
It must be center-aligned with the tile it connects to.
4.2 Connecting to Doubles
When connecting a tile to a double:
If space is available, place the tile in front of the double (up or down).
If there's no space vertically, it's allowed to place the tile to the left or right side of the double, ensuring the number matches.
5. Tile Orientation Rules
Chain Direction Tile Orientation
Expanding Up/Down Vertical (portrait)
Expanding Left/Right Horizontal (landscape)
Tiles must be rotated properly based on the chain’s direction.
6. Spacing Rules
Keep consistent spacing between all tiles.
Ensure tiles are center-aligned when connected, especially when connecting to doubles.
7. Placement Validation Checklist (Automated)
Before placing a tile:
Numbers must match between connecting sides.
No tile may overlap with any existing tile.
Tile must remain inside the play area.
Tile must be correctly rotated based on its direction.
Doubles must be placed perpendicularly and center-aligned.
If the current direction is blocked, a valid 90° turn must be performed automatically.
8. Drag-and-Drop Interaction Logic
The player must be able to drag and drop a tile onto the board.
A tile can only be dropped at a valid open end of the chain, where its number matches the connecting tile.
Dropping a tile in an invalid position must be blocked or rejected.