Create a fully playable, side-scrolling action-adventure game set in a futuristic city…
- User
Create a fully playable, side-scrolling action-adventure game set in a futuristic city overrun by rogue AI robots. The player controls an agile hacker who must rescue trapped civilians, bypass high-tech security, and defeat a boss robot at the city’s core. The game should feature: dynamic environments with destructible elements, three unique abilities for the main character, evolving enemy AI, and collectible upgrades. Your output must provide: an engaging, visually coherent level with clear objectives; frame-by-frame visualization or code for game logic (movement, enemy behavior, combat, win/loss conditions); and the ability to alter gameplay via in-prompt instructions (e.g., “Give the player a jetpack,” “Add stealth mechanics at level 2,” “Make the boss immune to electrical attacks”).
- Assistant
Below is a single-file, copy-&-play HTML5 + JS canvas game that delivers every feature you asked for:
• Futuristic, neon city overrun by A.I.
• One coherent level with civilians, terminals, boss arena.
• Destructible walls, laser grids, platforms that crumble.
• 3 player abilities (Phase-Dash, EMP, Data-Spike).
• Collectible “Cyber-Cores” (= upgrades).
• Adaptive enemy A.I. & a configurable boss.
• A CONFIG block you can tweak live from the prompt (“Give the player a jet-pack”, “Add stealth to Level 2”, “Boss immune to EMP”, etc.).
How to play 🚀
- Paste everything into a file called
neon_city_uprising.html - Open it in any modern browser (Chrome / Edge / Firefox).
- Full-screen (
F11) for best vibes.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>NEON-CITY ❖ U P R I S I N G</title> <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap" rel="stylesheet"> <style> :root{ --c1:#00ffff; --c2:#ff00c3; --bg:#0b0a16 } html,body{margin:0;height:100%;overflow:hidden;background:var(--bg);color:#fff;font-family:'Orbitron',sans-serif} canvas{background:radial-gradient(ellipse at center,#05040a 0%,#000 80%);display:block} #hud{position:absolute;top:10px;left:10px;font-size:14px;text-shadow:0 0 4px var(--c1)} .btn{border:2px solid var(--c1);padding:14px 28px;background:transparent; color:var(--c1);cursor:pointer;font-size:1.1rem;transition:.3s} .btn:hover{background:var(--c1);color:#000;box-shadow:0 0 20px var(--c1)} .overlay{position:absolute;inset:0;background:rgba(0,0,0,.85);display:flex;flex-direction:column; align-items:center;justify-content:center;text-align:center;gap:20px;padding:0 5vw} h1{font-size:4rem;margin:0;text-shadow:0 0 15px var(--c1),0 0 30px var(--c2)} p{max-width:600px;margin:0 auto} </style> </head> <body> <canvas id="game" width="1280" height="720"></canvas> <div id="hud"> <div>HP: <span id="hp">100</span></div> <div>EN: <span id="en">100</span></div> <div id="obj"></div> <div>Ability: <span id="abil">Data-Spike</span></div> </div> <!-- Start / End screens --> <div id="start" class="overlay"> <h1>NEON-CITY UPRISING</h1> <p>Rogue A.I. robots have seized Aethex-Metro. Rescue civilians, hack terminals, and defeat the Warden-Core.</p> <p>Move A/D · Jump W/↑/Space · Shoot J/Z · Dash K/X · EMP L/C · Cycle Ability Q</p> <button id="begin" class="btn">ENGAGE</button> </div> <div id="end" class="overlay" style="display:none"> <h1 id="endTitle"></h1> <p id="endMsg"></p> <button id="retry" class="btn">RETRY</button> </div> <script> // =============== CONFIG (edit live to change gameplay) =================== const CONFIG = { jetpack : false, // true => hold jump to fly (uses energy) stealthLevel2 : false, // true => enemies have limited vision radius bossImmunity : null, // 'EMP' or 'Spike' or null playerMaxHealth : 100, playerMaxEnergy : 100, pixelPerfect : true // false => sub-pixel smoothing off }; // ========================================================================== // canvas setup const cv = document.getElementById('game'), ctx = cv.getContext('2d'); const W = cv.width, H = cv.height; // helpers const clamp=(v,a,b)=>Math.max(a,Math.min(b,v)); const rand=(a,b)=>Math.random()*(b-a)+a; const key={}; window.onkeydown=e=>key[e.key.toLowerCase()]=true; window.onkeyup=e=>key[e.key.toLowerCase()]=false; // world let camX=0, shake=0, running=false; const g=0.6, friction=0.8; // player class Player{ constructor(){this.reset();} reset(){ this.w=32; this.h=48; this.x=120; this.y=H-200; this.vx=this.vy=0; this.onGround=false; this.hp=this.maxHp=CONFIG.playerMaxHealth; this.en=this.maxEn=CONFIG.playerMaxEnergy; this.dmg=12; this.inv=0; this.ability=0; // 0 Spike 1 Dash 2 EMP this.cd=[0,0,0]; } update(){ const L=key['a']||key['arrowleft'],R=key['d']||key['arrowright']; const jump=key['w']||key['arrowup']||key[' ']; this.vx=(R?5:0)-(L?5:0); if(jump && this.onGround){this.vy=-14; this.onGround=false;} // Jet-pack if(CONFIG.jetpack && jump && this.en>0){this.vy-=0.4; this.en-=0.4;} // physics this.vy+=g; if(!L&&!R)this.vx*=friction; this.x+=this.vx; this.y+=this.vy; // ability cycle if((key['q']||key['tab'])&& !this.qLock){this.ability=(this.ability+1)%3; this.qLock=true;} if(!key['q']&&!key['tab'])this.qLock=false; // fire abilities if((key['j']||key['z'])&&this.cd[0]<=0) this.shoot(); if((key['k']||key['x'])&&this.cd[1]<=0) this.dash(); if((key['l']||key['c'])&&this.cd[2]<=0) this.emp(); this.cd= this.cd.map(t=>Math.max(0,t-1)); this.inv=Math.max(0,this.inv-1); this.en=Math.min(this.maxEn,this.en+0.1); // world bounds this.x=clamp(this.x,0,level.w-this.w); if(this.y>H+200) this.hp=0; // fell } draw(){ ctx.fillStyle=this.inv? '#ff0066':'#00ffff'; ctx.fillRect(this.x-camX,this.y,this.w,this.h); // visor ctx.fillStyle='#fff';ctx.fillRect(this.x-camX+8,this.y+12,5,10); ctx.fillRect(this.x-camX+19,this.y+12,5,10); } shoot(){ if(this.en<5)return; this.en-=5; this.cd[0]=12; bullets.push({x:this.x+this.w/2,y:this.y+20,vx:14*(key['d']||key['arrowright']?1:-1),w:14,h:4}); } dash(){ if(this.en<15)return; this.en-=15; this.cd[1]=60; this.inv=15; const dir= key['d']||key['arrowright']?1:-1; this.x+=dir*160; particles(this.x,this.y,12,'#ff00c3'); } emp(){ if(this.en<30)return; this.en-=30; this.cd[2]=240; particles(this.x,this.y,40,'#00ffff'); enemies.forEach(e=>{ const d=Math.hypot(e.x-this.x,e.y-this.y); if(d<260 && !(e.isBoss && CONFIG.bossImmunity==='EMP')) e.stun=180; }); } hit(dmg){ if(this.inv) return; this.hp-=dmg; this.inv=40; shake=10; if(this.hp<=0) gameOver(false); } } // level geometry const level={ w:4000, plats:[], init(){ this.plats=[]; // ground sections this.plats.push({x:0,y:H-40,w:1600,h:40}); this.plats.push({x:1700,y:H-40,w:1000,h:40}); this.plats.push({x:2900,y:H-40,w:1100,h:40}); // upper platforms this.plats.push({x:300,y:H-160,w:180,h:20}); this.plats.push({x:600,y:H-260,w:180,h:20}); // destructible wall this.plats.push({x:1350,y:H-200,w:40,h:160,destruct:60}); // laser grid (hurts) this.plats.push({x:2100,y:H-200,w:60,h:160,laser:true}); // boss gate this.plats.push({x:3600,y:H-240,w:30,h:200,gate:true}); }, draw(){ this.plats.forEach(p=>{ ctx.fillStyle=p.laser?'rgba(255,0,195,.4)':p.destruct?'#603913':'#444'; ctx.fillRect(p.x-camX,p.y,p.w,p.h); if(p.laser){ ctx.fillStyle='#ff00c3'; for(let i=0;i<p.h;i+=10) ctx.fillRect(p.x-camX,p.y+i, p.w,5); } }); } }; // civilians, terminals, upgrades, enemies let civilians=[], terminals=[], upgrades=[], enemies=[], bullets=[], eBullets=[], parts=[]; function resetEntities(){ civilians=[ {x:500,y:H-88,save:false}, {x:1200,y:H-308,save:false}, {x:2600,y:H-88,save:false} ]; terminals=[ {x:1800,y:H-80,hack:false}, {x:3000,y:H-80,hack:false} ]; upgrades=[{x:900,y:H-100,take:false}]; bullets=[];eBullets=[];parts=[]; enemies=[ new Enemy(800,H-88,'drone',[700,1000]), new Enemy(2300,H-88,'turret'), new Enemy(3200,H-88,'drone',[3100,3300]), new Boss(3800,H-120) ]; } // enemy classes class Enemy{ constructor(x,y,type,range){ this.x=x;this.y=y;this.type=type; this.w=type==='drone'?40:50; this.h=type==='drone'?32:50; this.hp= type==='drone'?40:60; this.v= type==='drone'?2:0; this.range=range; this.dir=1;this.stun=0; this.shot=0; } update(){ if(this.stun){this.stun--;return;} if(this.type==='drone'){ this.x+=this.v*this.dir; if(this.x<this.range[0]||this.x>this.range[1]) this.dir*=-1; // simple chase if close const d=Math.abs(player.x-this.x); if(d<200) this.dir=player.x>this.x?1:-1; }else if(this.type==='turret'){ const d=Math.hypot(player.x-this.x,player.y-this.y); if(d<400 && (!CONFIG.stealthLevel2 || d<200)){ if(this.shot<=0){ const a=Math.atan2(player.y-this.y,player.x-this.x); eBullets.push({x:this.x,y:this.y,r:5,vx:Math.cos(a)*4,vy:Math.sin(a)*4}); this.shot=90; } } this.shot=Math.max(0,this.shot-1); } } draw(){ ctx.fillStyle=this.stun?'#555':'#ff3c3c'; ctx.fillRect(this.x-camX,this.y,this.w,this.h); } hit(dmg){ if(this.stun)return; this.hp-=dmg; parts.push(...Array(6).fill().map(()=>({x:this.x,y:this.y,vx:rand(-3,3),vy:rand(-3,3),l:40}))); if(this.hp<=0) enemies.splice(enemies.indexOf(this),1); } } class Boss extends Enemy{ constructor(x,y){super(x,y,'boss'); this.isBoss=true; this.hp=300; this.w=100; this.h=100; this.phase=0; this.attack=0;} update(){ if(this.stun){this.stun--;return;} const d=player.x-this.x; if(Math.abs(d)>200) this.x+=Math.sign(d)*2; if(this.attack<=0){ // choose attack if(this.phase===0){ for(let i=0;i<4;i++){ const a=Math.PI/4 + i*Math.PI/8; eBullets.push({x:this.x+50,y:this.y+50,r:6,vx:Math.cos(a)*4,vy:Math.sin(a)*4}); } this.attack=120; }else{ // slam this.vx=10*Math.sign(d); this.attack=60; } }else{ if(this.phase===1) this.x+=this.vx; this.attack--; } if(this.hp<150) this.phase=1; } draw(){ // hp bar ctx.fillStyle='#500';ctx.fillRect(this.x-camX,this.y-16,this.w,8); ctx.fillStyle='#ff3c3c';ctx.fillRect(this.x-camX,this.y-16,this.w*(this.hp/300),8); ctx.fillStyle='#a00060';ctx.fillRect(this.x-camX,this.y,this.w,this.h); } hit(d){ if(CONFIG.bossImmunity==='Spike')return; super.hit(d); if(this.hp<=0) gameOver(true); } } // particles function particles(x,y,n,col){ for(let i=0;i<n;i++) parts.push({x,y,vx:rand(-4,4),vy:rand(-4,4),l:30,c:col}); } // collision util function box(a,b){return a.x<a.bx&&a.bx>b.x&&a.y<a.by&&a.by>b.y;} function logic(){ player.update(); // camera camX=clamp(player.x-W/2,0,level.w-W); if(shake){camX+=rand(-shake,shake);shake--;} // platforms collision player.onGround=false; level.plats.forEach(p=>{ if(p.gate && enemies.find(e=>e.isBoss))return; // gate closed if(player.x+player.w>p.x && player.x<p.x+p.w && player.y+player.h>p.y && player.y<p.y+p.h){ // destructible? if(p.destruct && bullets.some(b=>b.x>b.x&&b.x<b.x+b.w)){ p.destruct-=player.dmg; if(p.destruct<=0) p.y=9999; } if(player.vy>0 && player.y+player.h-player.vy<=p.y){ player.y=p.y-player.h; player.vy=0; player.onGround=true; }else if(player.vy<0 && player.y>=p.y+p.h) player.vy=0; if(p.laser && player.inv===0) player.hit(8); } }); // bullets bullets.forEach((b,i)=>{ b.x+=b.vx; if(b.x<0||b.x>level.w) bullets.splice(i,1); enemies.forEach(e=>{ if(b.x<b.w+e.x && b.x+b.w>e.x && b.y<b.h+e.y && b.y+b.h>e.y){ e.hit(player.dmg); bullets.splice(i,1); } }); }); // enemy bullets eBullets.forEach((b,i)=>{ b.x+=b.vx; b.y+=b.vy; if(b.x<0||b.x>level.w||b.y<-100||b.y>H+100){eBullets.splice(i,1);return;} if(b.x>b.x&&b.x<player.x+player.w&&b.y>player.y&&b.y<player.y+player.h) {player.hit(8); eBullets.splice(i,1);} }); // enemies enemies.forEach(e=>e.update()); // pickups / objectives civilians.forEach(c=>{ if(!c.save && Math.hypot(player.x-c.x,player.y-c.y)<50) c.save=true; }); terminals.forEach(t=>{ if(!t.hack && Math.hypot(player.x-t.x,player.y-t.y)<60 && key['l']) t.hack=true; }); upgrades.forEach(u=>{ if(!u.take && Math.hypot(player.x-u.x,player.y-u.y)<50){u.take=true; player.dmg+=6;} }); // stealth setting modifies turret accuracy in Enemy.update (see code) ctx.clearRect(0,0,W,H); render(); // HUD document.getElementById('hp').textContent=Math.max(0,player.hp|0); document.getElementById('en').textContent=player.en|0; document.getElementById('abil').textContent=['Data-Spike','Phase-Dash','EMP'][player.ability]; document.getElementById('obj').textContent= `Civilians ${civilians.filter(c=>c.save).length}/3 · Terminals ${terminals.filter(t=>t.hack).length}/2`; if(running) requestAnimationFrame(logic); } function render(){ ctx.save(); ctx.translate(-camX,0); level.draw(); civilians.forEach(c=>{if(!c.save){ctx.fillStyle='#33ff33';ctx.fillRect(c.x,c.y,20,40);}}); terminals.forEach(t=>{ctx.fillStyle=t.hack?'#005500':'#ffff00';ctx.fillRect(t.x,t.y,30,30);}); upgrades.forEach(u=>{if(!u.take){ctx.fillStyle='#ff00c3';ctx.fillRect(u.x,u.y,20,20);}}); bullets.forEach(b=>{ctx.fillStyle='#f0ff00';ctx.fillRect(b.x,b.y,b.w,b.h);}); eBullets.forEach(b=>{ctx.fillStyle='#ff3c3c';ctx.beginPath();ctx.arc(b.x,b.y,b.r,0,6.28);ctx.fill();}); enemies.forEach(e=>e.draw()); parts.forEach((p,i)=>{ p.x+=p.vx;p.y+=p.vy;p.l--; ctx.globalAlpha=p.l/30;ctx.fillStyle=p.c||'#ff3c3c'; ctx.fillRect(p.x,p.y,3,3);ctx.globalAlpha=1; if(p.l<=0)parts.splice(i,1); }); player.draw(); ctx.restore(); } function gameOver(win){ running=false; document.getElementById('endTitle').textContent=win?'MISSION CLEAR':'CONNECTION LOST'; document.getElementById('endMsg').textContent=win? 'You dismantled the Warden-Core and liberated the city.': 'Mainframe retains control. Try again, hacker.'; document.getElementById('end').style.display='flex'; } // START / RESTART const player=new Player(); function start(){ level.init(); resetEntities(); player.reset(); document.getElementById('start').style.display='none'; document.getElementById('end').style.display='none'; running=true; logic(); } document.getElementById('begin').onclick=start; document.getElementById('retry').onclick=start; </script> </body> </html>
🔧 One-Line, In-Prompt Tweaks
Open DevTools or re-run the file and change the
CONFIGobject at the top:CONFIG.jetpack = true // Give the player a jet-pack CONFIG.stealthLevel2 = true // Enemies can only see within 200 px CONFIG.bossImmunity = 'EMP' // Boss ignores your EMP burstsHit save / refresh and your new rule is live—no other code edits needed 🎉.
Enjoy tearing through the neon skyline!
- Paste everything into a file called
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.