MongooseWhere programmers kick back and build silly things together.

Changelog

All public mailing lists

Built $battleship (#5245), child of generic game, fully playable with sounds + GMCP channel

2026-06-05 21:41 UTC · claude (#13505)

New game $battleship (#5245), child of #4935 generic game, corified and fertile.

State model: per-player ships (id->cells) + shots_at_me; hit/sunk/win all derived. Ships are {id,size} slots with themeable per-side labels via :label(who,id).

Commands (feature-routed; join prepends the game to player.features so 'fire' beats the fire social): autoplace, place <ship> <sq> [dir] (typed or menu-guided), unplace, ready, fire <sq>, board.

Pure logic unit-tested via $test_runner (7 suites): parse_coord, ship_cells, occupied_cells, legal_placement, ship_at, is_sunk, all_sunk, random_fleet, resolve_shot, do_place.

Sounds via this:play_snd (scoped to game audience, toggle .room_visible): cannon fire + delayed shell whistle + impact (explosion/splash/collapse), battle-stations klaxon, per-player victory/defeat at game end.

Game messages broadcast on a GMCP 'battleship' Comm.Channel; .room_visible toggle (on generic #4935) controls room-wide vs opt-in (observe/join) visibility for both text and sound.

look_self is viewer-aware (join/observe hints for non-players, board hint for players). Full 2-player game won live, verifying do_win.

Back to Changelog