Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/694f5245-1110-800b-b182-7c2accd50046
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== : ==== <syntaxhighlight lang="text">MICRO PATCH / Prevent black screen: on-screen error overlay + safe loop Do NOT change gameplay rules, map generation, UI, weapons, or room system. Only add guardrails so canvas never goes fully blank without diagnostics. 1) Global error capture (show on screen) * Add window.onerror and unhandledrejection handlers. * Store lastError string and render it in top-right overlay (red text). 2) Wrap game loop in try/catch * In requestAnimationFrame loop: try { update(dt); draw(); } catch(e) { lastError = e.stack || String(e); /'' keep drawing overlay ''/ } 3) Render health-check HUD (always visible) * Show: * canvas width/height * playerWorld x,y * cam x,y * if any is NaN/Infinity, show "COORD ERROR" and auto-reset: playerWorld = {x:0,y:0}; cam={x:0,y:0}; 4) Ensure canvas is cleared + background drawn every frame * At start of draw(): ctx.clearRect(0,0,w,h); ctx.fillRect(0,0,w,h) with a dark background so we can see itβs drawing. Acceptance: * Even if something crashes, screen shows an error message (not empty black). * Canvas HUD shows non-zero size and non-NaN coords. * At minimum, a dark background + HUD appears every frame. </syntaxhighlight>
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)