Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // import { BattleshipGame } from "./src/game.js"; | ||
| // import { UIController } from "./src/ui-controller.js"; | ||
| // import { ORIENTATION } from "./src/constants.js"; | ||
| // | ||
| // const uiController = new UIController(document); | ||
| // const game = new BattleshipGame(uiController); |
There was a problem hiding this comment.
Restore bootstrap logic in battleship.js
The module that should bootstrap the game is now entirely commented out. Because nothing executes, BattleshipGame is never instantiated and global handlers such as clickTarget, selectShip, or clickStartGame are never defined, so every inline event handler in index.html throws a ReferenceError when the user interacts with the page and the game cannot start. Please restore the script so the UI bridge is actually registered.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Restored the BattleshipGame bootstrap script so the UI controller, global bridge handlers, and placement preview listeners are registered when the page loads. battleship.jsL1-L55
Testing
⚠️ not run (not requested)
Summary
Encapsulated the game lifecycle in a BattleshipGame class that manages ship selection, placement validation, orientation messaging, CPU deployment, and win/loss handling while preventing duplicate attacks.
Extended the Board model to generate placement previews, guard against overlaps/out-of-bounds placements, and track attacked cells for both human and AI turns.
Wired the UI bridge and controllers to surface placement previews, apply battle-mode layout tweaks, and render hit/miss effects with refreshed neon-inspired board styling and animations.
Testing