Updates


SUMMARY OF ALL THE UPDATES I MADE
1. Adaptive/Responsive Gameplay
All fixed values (1920, 1080, 960, 540) were replaced with canvas.width, canvas.height, and canvas.width/2, canvas.height/2 so that the game runs correctly on ALL screen resolutions (PC, laptop, fullscreen, ultrawide, etc).
All wrap-around calculations, boundaries, spawns, bullets, stars, the ship, etc., are now fully dynamic.
2. Mouse Movement Standardization
The ship in mouse mode now has a fixed speed towards the cursor, regardless of the user's mouse DPI/sensitivity.
So everyone plays at the same speed, with no advantage for those with a faster mouse.
3. Centering and Proper Spawning
Anything related to the center of the screen (e.g., ship spawn, asteroid spawn, initial positions) now uses the real center (canvas.width/2, canvas.height/2), not hardcoded values.
Asteroids never spawn directly on top of the ship, no matter the resolution.
4. Canvas & UI Clearing
ctx.clearRect now clears the entire screen, not just 1920x1080 pixels.
All graphics (stars, asteroids, ship, UI) adapt to the screen dimensions.
5. Heart-Asteroid (Bonus Life)
The feature for spawning an asteroid with a heart for bonus life was fixed, so it triggers based on score, regardless of screen size.
6. Mouse Position Scaling
The mouse event now correctly accounts for canvas scaling, so aiming works perfectly on every resolution.
7. Minor Bugs and Syntax Fixes
I fixed issues to prevent the game from crashing due to typos, missing brackets, or incorrect sequence during resize/init.
If you want, play and try to find any other bugs—let me know if you spot something!
Leave a comment
Log in with itch.io to leave a comment.