Nuggets
A multiplayer gold-collection game with a C server and terminal clients.
Player A
0 goldPlayer B
0 goldSpectator
The whole map · A + BA: WASD B: arrows Shift: sprint Esc: pause
How to play
Hold a direction to keep moving; combine directions for diagonals. Shift + direction sprints to the wall. Collect * gold. The highest score wins when all 250 nuggets are claimed. You are @ in your own view; the other player appears as A or B. Step onto them to swap places and steal their gold. Walls block movement; # marks passages.
Each player can see up to three spots away, with walls and dark passages blocking the view. Move close to find gold and watch for footsteps. Hide the spectator to keep the full map secret. Quitting keeps your score; New game resets both players. A keyboard is required.
Browser adaptation of our team’s C game, with limited vision and gold stealing.
Watch the original C game
A networked terminal game
Nuggets is a UDP client-server game for up to 26 players and one spectator. The server loads an ASCII map, distributes 250 gold nuggets across randomly chosen piles, assigns each player a letter, and sends each client its own display and gold updates. The ncurses client turns keystrokes into protocol messages and redraws the terminal view.
Map and visibility
The grid module loads the map into a 250 by 250 cell structure. Each cell stores terrain, player, gold, and visibility state. The display is assembled per client, so a player sees a discovered portion of the map while a spectator receives the full view. Gold and player locations change as the server processes movement.
Protocol and game loop
A new player sends PLAY with a name and receives OK, GRID, GOLD, and DISPLAY messages. The server accepts KEY messages for movement, updates the game state, then broadcasts new displays. It also supports SPECTATE, replaces the prior spectator when necessary, and sends a final summary when the game ends.
Working as a team
Our four-person team split the game into a server, client interface, grid representation, and visibility calculations. The implementation plan assigned me grid handling and gold placement, with line-of-sight work shared with Gustavo Lopez-Flemming. The common message format let those parts connect into a playable game.