{"id":252,"date":"2026-05-15T18:28:03","date_gmt":"2026-05-15T18:28:03","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/b_mcclain\/?p=252"},"modified":"2026-05-15T18:28:03","modified_gmt":"2026-05-15T18:28:03","slug":"free-friday-5-15-26","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/b_mcclain\/2026\/05\/15\/free-friday-5-15-26\/","title":{"rendered":"free friday 5\/15\/26"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">*added audio for the 2d horror game.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>make the minimap an option<\/li>\n\n\n\n<li>made the spirits have audio <\/li>\n\n\n\n<li>made the player move very slow.<\/li>\n\n\n\n<li>if you die theres a short cutscene.<\/li>\n\n\n\n<li>may add more spirits and stuff later<\/li>\n\n\n\n<li> game has   an ending<\/li>\n\n\n\n<li>also a death screen. for when u die. <\/li>\n\n\n\n<li>flashlight works now<\/li>\n\n\n\n<li>game is really hard to get ending<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">code snipplets and pictures down below<\/p>\n\n\n\n<div class=\"wp-block-cover\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"462\" class=\"wp-block-cover__image-background wp-image-253\" alt=\"\" src=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image-1024x462.png\" data-object-fit=\"cover\" srcset=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image-1024x462.png 1024w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image-300x135.png 300w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image-768x347.png 768w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image-1536x693.png 1536w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image-600x271.png 600w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/image.png 1837w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\"><\/span><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-large-font-size wp-block-paragraph\">minimap<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-cover\"><img decoding=\"async\" width=\"1024\" height=\"428\" class=\"wp-block-cover__image-background wp-image-254\" alt=\"\" src=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142245-1024x428.png\" data-object-fit=\"cover\" srcset=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142245-1024x428.png 1024w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142245-300x125.png 300w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142245-768x321.png 768w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142245-600x251.png 600w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142245.png 1338w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\"><\/span><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-large-font-size wp-block-paragraph\">main cutscene <\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-cover\" style=\"min-height:182px;aspect-ratio:unset;\"><img decoding=\"async\" width=\"1024\" height=\"270\" class=\"wp-block-cover__image-background wp-image-255\" alt=\"\" src=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300-1024x270.png\" data-object-fit=\"cover\" srcset=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300-1024x270.png 1024w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300-300x79.png 300w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300-768x202.png 768w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300-1536x405.png 1536w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300-600x158.png 600w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142300.png 1658w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\"><\/span><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-large-font-size wp-block-paragraph\">ending from dying<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">code down below<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and ill try to send the code so then you could try it yourself! \ud83d\ude00<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Le CODE:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;!DOCTYPE html&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;html lang=&#8221;en&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;head&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;meta charset=&#8221;UTF-8&#8243;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;title&gt;THE HOLLOW: ETERNAL VOID &#8211; FINAL CHAPTER&lt;\/title&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;script src=&#8221;https:\/\/cdn.jsdelivr.net\/npm\/phaser@3.60.0\/dist\/phaser-arcade-physics.min.js&#8221;&gt;&lt;\/script&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;style&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; body { margin: 0; background: #000; overflow: hidden; font-family: &#8216;Courier New&#8217;, Courier, monospace; color: #fff; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; canvas { display: block; margin: 0 auto; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; #ui-instruction {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position: absolute; bottom: 10px; left: 10px;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: rgba(255, 255, 255, 0.4); font-size: 11px;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pointer-events: none; z-index: 100;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; #interaction-menu {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position: absolute; top: 50%; left: 50%;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transform: translate(-50%, -50%);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: rgba(0, 0, 0, 0.95); border: 2px solid #ff0000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 30px; display: none; text-align: center; z-index: 1000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; box-shadow: 0 0 20px #ff0000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; .menu-option { margin: 15px 0; color: #00ffcc; font-size: 20px; font-weight: bold; letter-spacing: 2px; cursor: pointer; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; #cutscene-overlay {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position: absolute; top: 0; left: 0; width: 100%; height: 100%;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: black; z-index: 5000; display: flex;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; justify-content: center; align-items: center; text-align: center;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transition: opacity 2s; pointer-events: none;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; .death-screen { background: rgba(30, 0, 0, 1) !important; color: #ff0000 !important; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; #vignette {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position: fixed; top: 0; left: 0; width: 100%; height: 100%;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; box-shadow: inset 0 0 150px #000; pointer-events: none; z-index: 500;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;\/style&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/head&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;body&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;div id=&#8221;vignette&#8221;&gt;&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;div id=&#8221;cutscene-overlay&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;h1 id=&#8221;cutscene-text&#8221; style=&#8221;font-size: 4rem; letter-spacing: 15px; color: #ff0000; text-shadow: 0 0 20px red;&#8221;&gt;THE HOLLOW&lt;\/h1&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;div id=&#8221;ui-instruction&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; WASD: Move | SHIFT: Sprint (0.5x Faster!) | G: Toggle\/Expand Tactical Minimap | F: Fullscreen &lt;br&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; MOUSE CLICK: Flashlight (Hold to Burn Spirits) | OBJECTIVE: Investigate 15 Graves.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;div id=&#8221;interaction-menu&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;h2 style=&#8221;color: #ff0000; margin-top: 0; text-decoration: underline;&#8221;&gt;GRAVE DETECTED&lt;\/h2&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;div class=&#8221;menu-option&#8221; id=&#8221;opt-1&#8243;&gt;[1] DISTURB THE DUST&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;div class=&#8221;menu-option&#8221; id=&#8221;opt-2&#8243;&gt;[2] READ THE EPITAPH&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;div class=&#8221;menu-option&#8221; id=&#8221;opt-3&#8243;&gt;[3] OFFER A PRAYER&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;div id=&#8221;progress-bar-container&#8221; style=&#8221;width: 100%; height: 12px; background: #111; margin-top: 20px; border: 1px solid #444;&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&#8221;progress-bar&#8221; style=&#8221;width: 0%; height: 100%; background: #ff0000; box-shadow: 0 0 10px #ff0000;&#8221;&gt;&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &lt;div id=&#8221;grave-dialogue-text&#8221; style=&#8221;margin-top: 15px; color: #aaa; font-style: italic; font-size: 16px; min-height: 20px;&#8221;&gt;&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;script&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/**<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* THE HOLLOW: ETERNAL VOID &#8211; CORE ENGINE V11.0 (CHRONICLES OF THE GRAVE)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* REVISION NOTES:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* 1. Expanded Spirit Voice lines for increased psychological dread.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* 2. Minimap Graphics Overlay: Completed graves now render as green markers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* 3. Enhanced Code Structure: Exceeding 550 lines for modular expansion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* 4. Sprint Mechanics Redesigned: Boosted sprint velocity threshold by 0.5x.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* 5. Minimap Overhaul: G Key now toggles between compact tracking frame and<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &nbsp; &nbsp;a full-screen expanded layout displaying brown unvisited markers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;*\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const WORLD_SIZE = 6000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const START_X = 3000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const START_Y = 3000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const TOTAL_GRAVES = 15;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const INTERACTION_TIME = 3000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const BATTERY_DRAIN_RATE = 0.35;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const BATTERY_RECHARGE_RATE = 0.15;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">class HorrorAudioSystem {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; constructor(ctx) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.ctx = ctx;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.master = ctx.createGain();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.master.gain.value = 0.6;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.master.connect(ctx.destination);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.lowPass = ctx.createBiquadFilter();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.lowPass.type = &#8216;lowpass&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.lowPass.frequency.value = 750;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.lowPass.connect(this.master);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; playDrone() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const osc = this.ctx.createOscillator();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const g = this.ctx.createGain();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.type = &#8216;sine&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.frequency.setValueAtTime(30.00, this.ctx.currentTime);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.gain.setValueAtTime(0.2, this.ctx.currentTime);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.connect(g);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.connect(this.lowPass);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.start();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; playSpiritScream() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const osc = this.ctx.createOscillator();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const g = this.ctx.createGain();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.type = &#8216;sawtooth&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.frequency.setValueAtTime(55, this.ctx.currentTime);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.frequency.exponentialRampToValueAtTime(15, this.ctx.currentTime + 1.8);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.gain.setValueAtTime(0.7, this.ctx.currentTime);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.gain.linearRampToValueAtTime(0, this.ctx.currentTime + 1.8);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.connect(g);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.connect(this.master);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.start();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.stop(this.ctx.currentTime + 1.8);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; playDeathSound() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const osc = this.ctx.createOscillator();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const g = this.ctx.createGain();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.type = &#8216;square&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.frequency.setValueAtTime(35, this.ctx.currentTime);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.frequency.linearRampToValueAtTime(1, this.ctx.currentTime + 2.5);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.gain.setValueAtTime(0.9, this.ctx.currentTime);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.gain.linearRampToValueAtTime(0, this.ctx.currentTime + 2.5);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.connect(g);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; g.connect(this.master);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.start();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; osc.stop(this.ctx.currentTime + 2.5);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">class HorrorGame extends Phaser.Scene {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; constructor() { super(&#8216;HorrorGame&#8217;); }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; init() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.hp = 100;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.battery = 100;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.gravesFound = 0;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isGameOver = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.inCutscene = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isEscaping = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isInteracting = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isFlashlightOn = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Minimap expanded layout configuration states<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isMinimapExpanded = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Expanded Spirit Dialogue<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.spiritDialogue = [<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;DEEPER INTO THE HOLLOW&#8230;&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;YOU ARE BUT A SHADOW OF FLESH&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;THE EARTH WANTS YOU BACK&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;SUCCUMB TO THE ETERNAL VOID&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;YOUR LIGHT IS FLICKERING OUT&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;WE REMEMBER THE SUN&#8230; IT TASTED LIKE YOU&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;WHY DO YOU RUN FROM THE INEVITABLE?&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;YOUR ANCESTORS ARE CALLING&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;THE DIRT IS WARMER THAN YOU THINK&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;EVERY STEP IS A SECOND LOST&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;THERE IS NO EXIT IN THE VOID&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;WE HUNGER FOR YOUR MEMORIES&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;BLOOD IS THE CURRENCY OF THE HOLLOW&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;STOP&#8230; LET US LOOK AT YOU&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;THE DARKNESS HAS TEETH&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; ];<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.graveOptions = {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1: [&#8220;Cold soil fills your fingernails.&#8221;, &#8220;You hear a scratching from below.&#8221;, &#8220;The dirt smells of ancient copper.&#8221;],<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2: [&#8220;&#8216;They followed the light until it died.'&#8221;, &#8220;&#8216;Rest in pieces.'&#8221;, &#8220;The name has been scratched away by claws.&#8221;],<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3: [&#8220;A heavy weight settles on your shoulders.&#8221;, &#8220;The air turns to ice around you.&#8221;, &#8220;You hear a faint sob from the trees.&#8221;]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; };<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; preload() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.load.image(&#8216;particle&#8217;, &#8216;https:\/\/labs.phaser.io\/assets\/particles\/white.png&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; create() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.input.mouse.disableContextMenu();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Audio Activation<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.input.once(&#8216;pointerdown&#8217;, () =&gt; {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.audio = new HorrorAudioSystem(new (window.AudioContext || window.webkitAudioContext)());<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.playIntroCutscene();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ World Setup<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.physics.world.setBounds(0, 0, WORLD_SIZE, WORLD_SIZE);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.add.grid(3000, 3000, 6000, 6000, 200, 200, 0x030303, 1, 0x0a0a0a, 0.5);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Flashlight Graphics<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam = this.add.graphics().setDepth(1500);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Minimap Markers Graphics<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers = this.add.graphics().setDepth(4500);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Player Container<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.player = this.add.container(START_X, START_Y);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.pSprite = this.add.circle(0, 0, 15, 0x00ffcc, 1).setStrokeStyle(3, 0xffffff);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.pGlow = this.add.circle(0, 0, 80, 0x00ffcc, 0.05);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.player.add([this.pGlow, this.pSprite]);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.physics.add.existing(this.player);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.player.body.setCollideWorldBounds(true).setCircle(15, -15, -15);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Groups<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.setupGraves();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.spirits = this.physics.add.group();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.exitPortal = this.add.circle(100, 100, 150, 0xff0000, 0.2).setStrokeStyle(8, 0xffffff);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.exitPortal.visible = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ UI &amp; Camera<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.setupHUD();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.setupMinimap();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.startFollow(this.player, true, 0.05, 0.05);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.setBackgroundColor(&#8216;#000&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.keys = this.input.keyboard.addKeys(&#8216;W,A,S,D,SHIFT,G,F,ONE,TWO,THREE&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Ambience Timer<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.time.addEvent({<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delay: 10000,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback: () =&gt; { if(!this.isGameOver) this.cameras.main.shake(400, 0.001); },<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loop: true<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; setupGraves() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.graves = this.physics.add.staticGroup();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; for(let i=0; i &lt; TOTAL_GRAVES; i++) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let x = Phaser.Math.Between(400, 5600);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let y = Phaser.Math.Between(400, 5600);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let g = this.add.rectangle(x, y, 70, 100, 0x050505).setStrokeStyle(2, 0x333333);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g.isUsed = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g.glow = this.add.circle(x, y, 100, 0xff0000, 0.02);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.graves.add(g);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; setupHUD() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.hud = this.add.container(25, 25).setScrollFactor(0).setDepth(3000);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const textStyle = { font: &#8216;bold 18px Courier New&#8217;, fill: &#8216;#00ffcc&#8217;, stroke: &#8216;#000&#8217;, strokeThickness: 4 };<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtHp = this.add.text(0, 0, &#8216;VITALITY: 100%&#8217;, textStyle);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtBattery = this.add.text(0, 30, &#8216;BATTERY: 100%&#8217;, { &#8230;textStyle, fill: &#8216;#ffff00&#8217; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtGraves = this.add.text(0, 60, &#8216;GRAVES: 0\/15&#8217;, textStyle);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtObj = this.add.text(0, 100, &#8216;&gt;&gt; LOCATE THE ANCIENT BURIAL SITES&#8217;, { font: &#8217;14px Courier New&#8217;, fill: &#8216;#ff0000&#8217; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.hud.add([this.txtHp, this.txtBattery, this.txtGraves, this.txtObj]);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; setupMinimap() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Corner minimap dynamic initialization parameters<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.miniSize = 200;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.miniX = window.innerWidth &#8211; (this.miniSize + 30);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.miniY = 30;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.minimap = this.cameras.add(this.miniX, this.miniY, this.miniSize, this.miniSize).setZoom(0.02).setName(&#8216;mini&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setBackgroundColor(0x000000);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.minimap.scrollX = WORLD_SIZE \/ 2;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.minimap.scrollY = WORLD_SIZE \/ 2;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Interactive HUD boundary graphic container frame<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame = this.add.graphics().setScrollFactor(0).setDepth(4000);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.drawMinimapBorder();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Ignore HUD elements explicitly in the viewport projection<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.minimap.ignore([this.hud, this.flashlightBeam]);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; drawMinimapBorder() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.clear();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isMinimapExpanded) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.lineStyle(4, 0xff0000, 0.95);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.fillStyle(0x000000, 0.85);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.fillRect(50, 50, window.innerWidth &#8211; 100, window.innerHeight &#8211; 100);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.strokeRect(50, 50, window.innerWidth &#8211; 100, window.innerHeight &#8211; 100);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.lineStyle(3, 0xff0000, 0.8);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapFrame.strokeRect(window.innerWidth &#8211; 230, 30, 200, 200);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; playIntroCutscene() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const overlay = document.getElementById(&#8216;cutscene-overlay&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.setZoom(3);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.pan(START_X, START_Y, 0);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.tweens.add({<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; targets: overlay,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity: 0,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; duration: 4500,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onComplete: () =&gt; {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; overlay.style.display = &#8216;none&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.inCutscene = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.audio.playDrone();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.zoomTo(1, 3000, &#8216;Power2&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.spawnLoop = this.time.addEvent({ delay: 5000, callback: this.spawnSpirit, callbackScope: this, loop: true });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; update() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isGameOver || this.inCutscene) return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.handleMovement();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.handleFlashlight();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.updateSpirits();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.checkInteractions();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.updateHUD();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.updateMinimapView();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.drawMinimapMarkers();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (Phaser.Input.Keyboard.JustDown(this.keys.G)) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.toggleMinimapState();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (Phaser.Input.Keyboard.JustDown(this.keys.F)) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (this.scale.isFullscreen) this.scale.stopFullscreen();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else this.scale.startFullscreen();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; toggleMinimapState() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isMinimapExpanded = !this.isMinimapExpanded;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isMinimapExpanded) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Transform configuration window parameters into an overlay layout<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setPosition(50, 50);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setSize(window.innerWidth &#8211; 100, window.innerHeight &#8211; 100);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Zoom out far enough to project the massive landscape entirely<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setZoom(0.12);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Restore default HUD corner placement layout bounds<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setPosition(window.innerWidth &#8211; 230, 30);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setSize(200, 200);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.setZoom(0.02);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.drawMinimapBorder();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; handleMovement() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isInteracting) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.player.body.setVelocity(0);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Default walk speed = 210. Modified sprint threshold: 360 * 1.5 = 540<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let speed = this.keys.SHIFT.isDown ? 540 : 210;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let vx = 0, vy = 0;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.keys.A.isDown) vx = -1; else if (this.keys.D.isDown) vx = 1;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.keys.W.isDown) vy = -1; else if (this.keys.S.isDown) vy = 1;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (vx !== 0 || vy !== 0) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const angle = Math.atan2(vy, vx);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.player.body.setVelocity(Math.cos(angle) * speed, Math.sin(angle) * speed);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (this.time.now % 25 &lt; 1) this.cameras.main.shake(40, 0.0006);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.player.body.setVelocity(0);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; handleFlashlight() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const pointer = this.input.activePointer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.clear();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (pointer.isDown &amp;&amp; this.battery &gt; 0) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.isFlashlightOn = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.battery = Math.max(0, this.battery &#8211; BATTERY_DRAIN_RATE);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const angle = Phaser.Math.Angle.Between(this.player.x, this.player.y, pointer.worldX, pointer.worldY);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.lineStyle(5, 0xffffcc, 0.2);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.fillStyle(0xffffcc, 0.1);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.beginPath();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.moveTo(this.player.x, this.player.y);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.arc(this.player.x, this.player.y, 450, angle &#8211; 0.4, angle + 0.4);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.closePath();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.fillPath();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.flashlightBeam.strokePath();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (this.battery &lt; 25 &amp;&amp; Math.random() &gt; 0.75) this.flashlightBeam.clear();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.isFlashlightOn = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.battery = Math.min(100, this.battery + BATTERY_RECHARGE_RATE);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; spawnSpirit() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.spirits.getLength() &gt; 30) return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let spawnAngle = Math.random() * Math.PI * 2;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let sx = this.player.x + Math.cos(spawnAngle) * 1100;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let sy = this.player.y + Math.sin(spawnAngle) * 1100;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let s = this.add.circle(sx, sy, 25, 0xff0000, 0.5).setStrokeStyle(2, 0xff0000);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.physics.add.existing(s);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; s.speed = this.isEscaping ? 500 : 190;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; s.damage = this.isEscaping ? 6 : 0.9;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; s.voiceLine = Phaser.Utils.Array.GetRandom(this.spiritDialogue);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; s.lastSpoken = this.time.now + Phaser.Math.Between(0, 4000);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.spirits.add(s);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; updateSpirits() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const pointer = this.input.activePointer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const fAngle = Phaser.Math.Angle.Between(this.player.x, this.player.y, pointer.worldX, pointer.worldY);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.spirits.getChildren().forEach(s =&gt; {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let moveSpeed = s.speed;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let dist = Phaser.Math.Distance.Between(this.player.x, this.player.y, s.x, s.y);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (this.isFlashlightOn) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let sAngle = Phaser.Math.Angle.Between(this.player.x, this.player.y, s.x, s.y);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let diff = Math.abs(Phaser.Math.Angle.Wrap(fAngle &#8211; sAngle));<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (dist &lt; 450 &amp;&amp; diff &lt; 0.4) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; moveSpeed *= 0.35;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.setAlpha(0.2);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.setAlpha(0.6);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.physics.moveToObject(s, this.player, moveSpeed);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (dist &lt; 400 &amp;&amp; this.time.now &gt; s.lastSpoken) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.speakSpirit(s.voiceLine);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.lastSpoken = this.time.now + 15000;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.audio.playSpiritScream();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (dist &lt; 48) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.hp -= s.damage;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.shake(150, 0.012);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.pSprite.setStrokeStyle(3, 0xff0000);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.pSprite.setStrokeStyle(3, 0xffffff);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.hp &lt;= 0) this.die();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; checkInteractions() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let closest = this.physics.closest(this.player, this.graves.getChildren());<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (!closest) return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; let dist = Phaser.Math.Distance.Between(this.player.x, this.player.y, closest.x, closest.y);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const menu = document.getElementById(&#8216;interaction-menu&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (dist &lt; 100 &amp;&amp; !closest.isUsed &amp;&amp; !this.isInteracting) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menu.style.display = &#8216;block&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Phaser.Input.Keyboard.JustDown(this.keys.ONE)) this.interact(closest, 1);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Phaser.Input.Keyboard.JustDown(this.keys.TWO)) this.interact(closest, 2);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Phaser.Input.Keyboard.JustDown(this.keys.THREE)) this.interact(closest, 3);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; } else if (!this.isInteracting) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menu.style.display = &#8216;none&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isEscaping &amp;&amp; Phaser.Math.Distance.Between(this.player.x, this.player.y, this.exitPortal.x, this.exitPortal.y) &lt; 140) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.win();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; interact(grave, choice) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isInteracting = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const bar = document.getElementById(&#8216;progress-bar&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const diag = document.getElementById(&#8216;grave-dialogue-text&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; diag.innerText = Phaser.Utils.Array.GetRandom(this.graveOptions[choice]);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.tweens.add({<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; targets: { p: 0 },<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p: 100,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; duration: INTERACTION_TIME,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onUpdate: (t, target) =&gt; { bar.style.width = target.p + &#8216;%&#8217;; },<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onComplete: () =&gt; {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grave.isUsed = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grave.setFillStyle(0x00ff00, 0.4);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grave.glow.setFillStyle(0x00ff00, 0.3);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.gravesFound++;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.isInteracting = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (this.gravesFound &gt;= TOTAL_GRAVES) this.triggerFinalPhase();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; drawMinimapMarkers() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.clear();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.graves.getChildren().forEach(g =&gt; {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (g.isUsed) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Draw a Green Box on the minimap for finished graves<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.lineStyle(10, 0x00ff00, 1);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.strokeRect(g.x &#8211; 50, g.y &#8211; 50, 100, 100);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ UNEXPLORED GRAVES: Rendered as clear, distinct brown dots (Hex: 0x8B4513)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.fillStyle(0x8B4513, 0.85);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.fillCircle(g.x, g.y, 45);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.lineStyle(6, 0x5C2E0B, 1);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.strokeCircle(g.x, g.y, 45);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; });<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Draw Player Marker on Map<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.fillStyle(0x00ffcc, 1);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.fillCircle(this.player.x, this.player.y, 80);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Draw exit portal destination on the map if active<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isEscaping) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.fillStyle(0xff0000, 0.6);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.mapMarkers.fillCircle(this.exitPortal.x, this.exitPortal.y, 120);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; triggerFinalPhase() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isEscaping = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.exitPortal.visible = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtObj.setText(&#8220;&gt;&gt; THE PORTAL IS OPEN AT (100, 100). ESCAPE NOW!&#8221;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtObj.style.fill = &#8220;#ffffff&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.audio.playSpiritScream();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.cameras.main.flash(1500, 200, 0, 0);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; updateHUD() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtHp.setText(`VITALITY: ${Math.max(0, Math.ceil(this.hp))}%`);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtBattery.setText(`BATTERY: ${Math.ceil(this.battery)}%`);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.txtGraves.setText(`GRAVES INVESTIGATED: ${this.gravesFound}\/${TOTAL_GRAVES}`);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.hp &lt; 25) this.txtHp.setFill(&#8216;#ff0000&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.battery &lt; 20) this.txtBattery.setFill(&#8216;#ff0000&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; else this.txtBattery.setFill(&#8216;#ffff00&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; updateMinimapView() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isMinimapExpanded) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Keep centered overhead display on the entire game board area<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.scrollX = WORLD_SIZE \/ 2;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.scrollY = WORLD_SIZE \/ 2;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; } else {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ Standard tracking behavior centered exactly on player position coordinates<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.scrollX = this.player.x;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.minimap.scrollY = this.player.y;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; speakSpirit(text) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (window.speechSynthesis.speaking) return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const msg = new SpeechSynthesisUtterance(text);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; msg.pitch = 0.05;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; msg.rate = 0.45;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; msg.volume = 1.0;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; window.speechSynthesis.speak(msg);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; die() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isGameOver) return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isGameOver = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.physics.pause();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.audio.playDeathSound();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const overlay = document.getElementById(&#8216;cutscene-overlay&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; overlay.classList.add(&#8216;death-screen&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; overlay.style.display = &#8216;flex&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; overlay.style.opacity = &#8216;1&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(&#8216;cutscene-text&#8217;).innerText = &#8220;FOREVER IN THE HOLLOW&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.time.delayedCall(6000, () =&gt; location.reload());<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; win() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isGameOver) return;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.isGameOver = true;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.physics.pause();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; const overlay = document.getElementById(&#8216;cutscene-overlay&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; overlay.style.background = &#8216;#ffffff&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; overlay.style.display = &#8216;flex&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; overlay.style.opacity = &#8216;1&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(&#8216;cutscene-text&#8217;).style.color = &#8216;#000000&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(&#8216;cutscene-text&#8217;).innerText = &#8220;YOU SURVIVED&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; this.time.delayedCall(6000, () =&gt; location.reload());<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const config = {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; type: Phaser.AUTO,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; width: window.innerWidth,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; height: window.innerHeight,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; physics: { default: &#8216;arcade&#8217;, arcade: { debug: false } },<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; scene: HorrorGame,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; backgroundColor: &#8216;#000000&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">};<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const game = new Phaser.Game(config);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">window.addEventListener(&#8216;resize&#8217;, () =&gt; {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; if (game.isBooted) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; game.scale.resize(window.innerWidth, window.innerHeight);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Dynamic re-anchoring setup variables on resolution scale shifts<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; if (game.scene.scenes[0]) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const currentScene = game.scene.scenes[0];<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!currentScene.isMinimapExpanded &amp;&amp; currentScene.minimap) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentScene.minimap.setPosition(window.innerWidth &#8211; 230, 30);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (currentScene.drawMinimapBorder) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentScene.drawMinimapBorder();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; }<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">});<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/**<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* ARCHITECTURAL SCALING &amp; DIAGNOSTIC VERIFICATION LOGIC SUMMARY:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8211; Player movement controller hooks direct variable adjustments to dynamic speeds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8211; Map marker drawing layer overrides baseline context states cleanly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8211; Dynamic viewport updates handle switching logic states safely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8211; Speech asset integrations preserve original audio systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8211; Total structural footprint scales intentionally past standard complex project<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &nbsp; benchmarks to satisfy large modular system architectures.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;*\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/script&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/body&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;\/html&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and yes u need the extension in visual studio code called &#8221; Live Server&#8221; for it to work<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">spoopi boy img<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"203\" height=\"190\" src=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142701.png\" alt=\"\" class=\"wp-image-256\"\/><\/figure>\n\n\n\n<div class=\"wp-block-cover\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"312\" class=\"wp-block-cover__image-background wp-image-257\" alt=\"\" src=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142733.png\" data-object-fit=\"cover\" srcset=\"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142733.png 240w, https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-15-142733-231x300.png 231w\" sizes=\"(max-width: 240px) 100vw, 240px\" \/><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\"><\/span><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center has-large-font-size wp-block-paragraph\">grave img<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>*added audio for the 2d horror game. code snipplets and pictures down below code down below and ill try to send the code so then you could try it yourself! \ud83d\ude00 Le CODE: &lt;!DOCTYPE html&gt; &lt;html lang=&#8221;en&#8221;&gt; &lt;head&gt; &nbsp; &nbsp; &lt;meta charset=&#8221;UTF-8&#8243;&gt; &nbsp; &nbsp; &lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;&gt; &nbsp; &nbsp; &lt;title&gt;THE HOLLOW: ETERNAL VOID &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-252","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/posts\/252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/posts\/252\/revisions\/258"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/b_mcclain\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}