Skip to content

Codex test#1

Open
JeremyDuncan wants to merge 4 commits intomainfrom
codex-test
Open

Codex test#1
JeremyDuncan wants to merge 4 commits intomainfrom
codex-test

Conversation

@JeremyDuncan
Copy link
Copy Markdown
Owner

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

⚠️ npx http-server . --port 3000 (Manual QA pending: place every ship, start the match, confirm hover previews, and verify hit/miss/retry flows once both boards trade attacks.)

@JeremyDuncan
Copy link
Copy Markdown
Owner Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1 to +6
// 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex address that feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant