Day 3
After a full day of work the game is technically playable, though a lot still needs to be done — from ship placement to UI polish. Here’s what I got done: I rewrote the hit/miss detection logic from scratch to fix some bugs, added a text label and animations to clearly show the player when they miss, locked grid interaction during animations to prevent exploits, and built a function that tracks correct hits to detect when all ships have been sunk. Oh, and on community advice I switched the UI language from Italian to English to lower the barrier for more players.
Introduce aversario pointer and fix turn assignment/spacing. Add mouse click handling to record attacks (giocatore->attachiVS) when clicking inside the grid, and draw hit markers (GRAY) where the opponent’s hitbox and player’s attacks coincide. Add null-check for both giocatore and aversario and normalize PosTesX adjustments. Minor style/whitespace fixes and use of consistent modulo spacing.
Implement ship placement tracking to prevent players from ending their turn until all ships are positioned. Added DimNave field to track placed ship cells, disabled the turn-end button until placement is complete, and added visual feedback (button graying) when ships haven’t all been placed. Also added toggle functionality to remove previously placed ships.
I have finished the UI foundations with a working grid and if you click on the text “Fine turno” the turn is passed to the second player. The ship count control logic is missing, along with a clearer UI, and I need to block the console from appearing at startup. (Just to be transparent, I translated this report with AI, I’m Italian)