WIP: Add multiplayer Snake game
N-player (2-8) real-time Snake game alongside Connect 4. Lobby has tabs to switch between games. Players join via invite link with 10-second countdown. Game loop runs at tick-based intervals with NATS pub/sub for state sync. Keyboard input not yet working (Datastar keydown binding issue still under investigation).
This commit is contained in:
@@ -15,7 +15,7 @@ WHERE id = ?;
|
||||
DELETE FROM games WHERE id = ?;
|
||||
|
||||
-- name: GetActiveGames :many
|
||||
SELECT * FROM games WHERE status < 2;
|
||||
SELECT * FROM games WHERE game_type = 'connect4' AND status < 2;
|
||||
|
||||
-- name: CreateGamePlayer :exec
|
||||
INSERT INTO game_players (game_id, user_id, guest_player_id, nickname, color, slot)
|
||||
@@ -41,5 +41,5 @@ SELECT
|
||||
FROM games g
|
||||
JOIN game_players gp_user ON g.id = gp_user.game_id AND gp_user.user_id = ?
|
||||
LEFT JOIN game_players gp_opponent ON g.id = gp_opponent.game_id AND gp_opponent.slot != gp_user.slot
|
||||
WHERE g.status < 2
|
||||
WHERE g.game_type = 'connect4' AND g.status < 2
|
||||
ORDER BY g.updated_at DESC;
|
||||
|
||||
Reference in New Issue
Block a user