صاروخ ليمو
by ChromeFlame24139 lines20.1 KB🛠️ Three.js (3D graphics)
<!DOCTYPE html>
<html lang="ar" dir="rtl"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>صاروخ ليمو</title>
<style>
:root{--bg:#8fd3ff;--fg:#1b1b1b;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#0d1620;--fg:#f2f2f2}}
:root[data-theme="dark"]{--bg:#0d1620;--fg:#f2f2f2}
html,body{height:100%;margin:0;background:var(--bg);color:var(--fg);font-family:system-ui,"Segoe UI",Tahoma,sans-serif;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
canvas{position:absolute;inset:0;width:100%;height:100%;display:block;image-rendering:pixelated}
#hud{position:absolute;top:calc(env(safe-area-inset-top,0px) + 8px);left:8px;right:8px;display:flex;gap:6px;justify-content:space-between;font-weight:700;font-size:14px;color:#fff;text-shadow:0 1px 3px #000;pointer-events:none}
#hud span{background:rgba(0,0,0,.55);padding:5px 9px;border-radius:0;border:3px solid #ffe14a;box-shadow:3px 3px 0 #000}
#fuel{position:absolute;top:calc(env(safe-area-inset-top,0px) + 52px);left:12px;right:12px;height:8px;background:rgba(0,0,0,.4);border-radius:6px;overflow:hidden}
#fuel i{display:block;height:100%;width:100%;background:#ffe14a}
#cx{position:absolute;top:50%;left:50%;width:22px;height:22px;margin:-11px;color:#fff;font:700 22px/22px monospace;text-align:center;text-shadow:0 0 4px #000;pointer-events:none;opacity:.8}
#ov{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:rgba(10,15,20,.55);color:#fff;text-align:center;padding:24px}
#ov h1{margin:0;font-size:34px;color:#ffe14a;text-shadow:3px 3px 0 #3b6e12}
#ov p{margin:0;max-width:300px;line-height:1.7;font-size:16px}
#ov button{font:700 22px inherit;font-family:inherit;padding:12px 38px;border:4px solid #3b6e12;background:#ffe14a;color:#222;border-radius:0;box-shadow:0 5px 0 #3b6e12}
#ov small{opacity:.7;font-size:12px}
#ov{background:radial-gradient(ellipse at 50% 30%,rgba(20,40,70,.55),rgba(5,8,15,.92));overflow-y:auto;justify-content:flex-start;padding:calc(env(safe-area-inset-top,0px) + 14px) 10px 20px;touch-action:pan-y}
.card{margin:auto;width:min(92vw,360px);box-sizing:border-box;background:linear-gradient(#1c2a44,#101a2e);border:4px solid #ffe14a;box-shadow:6px 6px 0 #000,inset 0 0 0 3px #2d4468;padding:16px 14px 12px;display:flex;flex-direction:column;align-items:center;gap:10px}
.card .top{display:flex;gap:8px;width:100%;justify-content:space-between;font-size:13px}
.card .top span{background:#0a1220;border:2px solid #3b6e12;padding:3px 8px;color:#fff}
.card .top b{color:#ffe14a;font-size:15px}
.card .wn{font-size:14px;color:#9fd8ff}
.card h1{font-size:26px;margin:0}
.card .stars{font-size:40px;line-height:1;color:#ffe14a;text-shadow:0 3px 0 #7a5a00;letter-spacing:4px}.card .stars i{color:#46506a;font-style:normal;text-shadow:none}
.card .obj,.card .meta{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;font-size:12px}
.card .obj span{background:#2a1a1a;border:2px solid #ff3b3b;padding:3px 8px;color:#fff}
.card .meta span{background:#0a1220;padding:3px 8px;color:#ffe14a;border:2px solid #2d4468}
.card details{width:100%;font-size:13px;color:#fff}.card summary{text-align:center;padding:6px;border:2px dashed #3b6e12;cursor:pointer}
#ar{position:absolute;display:none;flex-direction:column;align-items:center;transform:translate(-50%,-50%);color:#fff;font-weight:700;font-size:15px;text-shadow:0 1px 3px #000;pointer-events:none;z-index:2}
#ar b{color:#ff3b3b;font-size:30px;line-height:1;text-shadow:0 0 4px #fff,0 1px 3px #000}
#ar span{background:rgba(0,0,0,.55);padding:2px 8px;border-radius:8px;border:2px solid #ff3b3b}
</style></head><body>
<div id="hud"><span id="a"></span><span id="b"></span><span id="c"></span><span id="d"></span></div>
<div id="fuel"><i></i></div><div id="cx">+</div><div id="ar"><b>▲</b><span></span></div>
<div id="ov"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
const R=Math.random,cl=(v,a,b)=>Math.max(a,Math.min(b,v));
const H=(x,z)=>{const d=Math.hypot(x,z);return 11-d*.075+Math.sin(x*.05)*3+Math.cos(z*.06)*3+Math.sin((x+z)*.11)*1.2};
const mat=c=>new THREE.MeshPhongMaterial({color:c,shininess:0,flatShading:true});
const scene=new THREE.Scene();scene.background=new THREE.Color(0x8fd3ff);scene.fog=new THREE.Fog(0x8fd3ff,70,270);
const cam=new THREE.PerspectiveCamera(70,1,.1,400);
const ren=new THREE.WebGLRenderer({antialias:false});ren.setPixelRatio(1);
document.body.insertBefore(ren.domElement,document.body.firstChild);
function rs(){const PX=Math.max(2,Math.round(innerWidth/220));ren.setSize(Math.ceil(innerWidth/PX),Math.ceil(innerHeight/PX),false);cam.aspect=innerWidth/innerHeight;cam.updateProjectionMatrix()}
addEventListener('resize',rs);rs();
scene.add(new THREE.HemisphereLight(0xffffff,0x557744,.9));
const sun=new THREE.DirectionalLight(0xfff2c0,.8);sun.position.set(50,80,30);scene.add(sun);
// terrain
const g=new THREE.PlaneGeometry(420,420,70,70);g.rotateX(-Math.PI/2);
const p=g.attributes.position,cols=[];
for(let i=0;i<p.count;i++){const y=H(p.getX(i),p.getZ(i));p.setY(i,Math.max(y,-1.5));const c=new THREE.Color(y<1.2?0xe8d18a:y<8?0x4fa83d:0x3b8a30);cols.push(c.r,c.g,c.b)}
g.setAttribute('color',new THREE.Float32BufferAttribute(cols,3));g.computeVertexNormals();
const ca=g.attributes.color,TH=[['#8fd3ff','#2a8fd6',0xe8d18a,0x4fa83d,0x3b8a30],['#f3c98b','#3aa6b9',0xe8c27a,0xd9a441,0xc48a2f],['#cfe6f5','#4a7fa8',0xf0f4f8,0xe6eef5,0xcddbe6],['#101830','#13304f',0x5b5648,0x2f5a3a,0x244a2e],['#5a2a2a','#a8321a',0x3a2a28,0x5a3a30,0x7a3a2a],['#ffc6e5','#7ad0ff',0xffe6a8,0xff9ed0,0xc99bff]];
function paint(th){const c=new THREE.Color();for(let i=0;i<p.count;i++){const y=p.getY(i);c.set(y<1.2?th[2]:y<8?th[3]:th[4]);ca.setXYZ(i,c.r,c.g,c.b)}ca.needsUpdate=true}
scene.add(new THREE.Mesh(g,new THREE.MeshPhongMaterial({vertexColors:true,flatShading:true,shininess:0})));
const water=new THREE.Mesh(new THREE.PlaneGeometry(1200,1200).rotateX(-Math.PI/2),new THREE.MeshPhongMaterial({color:0x2a8fd6,shininess:0}));scene.add(water);
// rocket
const rocket=new THREE.Group(),flame=new THREE.Mesh(new THREE.BoxGeometry(.6,.6,1.8),new THREE.MeshBasicMaterial({color:0xffa31a}));
const lc=document.createElement('canvas');lc.width=lc.height=256;const lx2=lc.getContext('2d');lx2.fillStyle='#e6e6e6';lx2.fillRect(0,0,256,256);lx2.fillStyle='#2b2b2b';lx2.font='bold 76px Arial Black,Arial,sans-serif';lx2.textAlign='center';lx2.textBaseline='middle';
for(const px of[64,192]){lx2.save();lx2.translate(px,128);lx2.rotate(-Math.PI/2);lx2.fillText('LOOM',0,0);lx2.restore()}
const body=new THREE.Mesh(new THREE.CylinderGeometry(.35,.35,2.4,16).rotateX(Math.PI/2),new THREE.MeshPhongMaterial({map:new THREE.CanvasTexture(lc),shininess:0}));
const nose=new THREE.Mesh(new THREE.ConeGeometry(.35,.9,8).rotateX(Math.PI/2),mat(0x3b8a30));nose.position.z=1.6;
flame.position.z=-2;
rocket.add(body,nose,flame);rocket.scale.setScalar(1.3);
for(let i=0;i<4;i++){const f=new THREE.Mesh(new THREE.BoxGeometry(.08,.9,.6),mat(0xe0661a));f.position.z=-1;f.rotation.z=i*Math.PI/2;f.translateY(.5);rocket.add(f)}
scene.add(rocket);
const SK=[['ليمون','#e6e6e6','#2b2b2b',0],['ذهبي','#f2c230','#5a3b00',50],['نيون','#39ff88','#06301a',100],['ناري','#ff5a1a','#fff2a8',150],['ليلي','#1b1f3a','#ffe14a',200],['وردي','#ff7ab8','#ffffff',250]];
let own=[0],cur=0,coins=0,ls=0,up={b:0,f:0,t:0,r:0},bossName='',thm={},BC=[['#e6e6e6','#2b2b2b'],['#f2c230','#5a3b00'],['#39ff88','#06301a'],['#ff5a1a','#fff2a8'],['#1b1f3a','#ffe14a'],['#ff7ab8','#ffffff'],['#ffffff','#d62a2a'],['#6a2bd6','#ffe14a']],NC=[0x3b8a30,0xe0382a,0xf2c230,0xe0382a],FN=[[0xe0661a,4],[0x2a6fd6,4],[0xf2c230,4],[0x222222,2]],FL=[0xffa31a,0x39a8ff,0x39ff88,0xc04aff],cus={on:false,name:'LOOM',body:0,nose:0,fin:0,flame:0},lastSk;
try{Object.assign(cus,JSON.parse(localStorage.getItem('lrc')||'{}'))}catch(e){}
const nsB=new THREE.Mesh(new THREE.SphereGeometry(.35,10,8),mat(0xe0382a));nsB.position.z=1.25;nsB.visible=false;rocket.add(nsB);
try{const s=JSON.parse(localStorage.getItem('lr')||'{}');own=s.own||[0];cur=s.cur||0;coins=s.coins||0;up=s.up||up}catch(e){}
function sv(){try{localStorage.setItem('lr',JSON.stringify({own,cur,coins,up}))}catch(e){}}
function skin(i){if(lastSk!==undefined&&i!==lastSk)cus.on=false;lastSk=i;applyR(i)}
function skinOld(i){const s=SK[i]||SK[0];lx2.fillStyle=s[1];lx2.fillRect(0,0,256,256);lx2.fillStyle=s[2];for(const px of[64,192]){lx2.save();lx2.translate(px,128);lx2.rotate(-Math.PI/2);lx2.fillText('LOOM',0,0);lx2.restore()}body.material.map.needsUpdate=true}
skin(cur);
function skRow(){const r=document.createElement('div');r.style.cssText='display:flex;gap:6px;flex-wrap:wrap;justify-content:center;max-width:330px;font-size:13px';
const draw=()=>{r.innerHTML='<div style="width:100%">🪙 '+coins+' — سكنات الصاروخ</div>';SK.forEach((s,i)=>{const b=document.createElement('button'),o=own.includes(i);b.textContent=(cur===i?'✔ ':'')+s[0]+(o?'':' 🪙'+s[3]);
b.style.cssText='font-weight:700;font-size:13px;padding:6px 10px;border:2px solid #3b6e12;border-radius:10px;box-shadow:none;background:'+(cur===i?'#ffe14a':'#fff')+';color:#222';
b.onclick=e=>{e.stopPropagation();if(o)cur=i;else if(coins>=s[3]){coins-=s[3];own.push(i);cur=i}else return;skin(cur);sv();draw()};r.appendChild(b)})};draw();return r}
SK.push(['أسود','#111111','#f2c230',300],['جليدي','#bfefff','#1b4f72',350],['حمم','#7a1a0a','#ffb02e',400],['زمرد','#0f8a5f','#d8ffe9',450],['كاندي','#ffa6d9','#7a2a6a',500],['أسطوري','#6a2bd6','#ffe14a',800]);
skin(cur);const UP=[['b','💥 قوة الانفجار'],['f','⛽ الوقود'],['t','🎯 التحكم'],['r','🚀 صواريخ زيادة']];
const TT=['الرئيس','الملك','الأمير','السلطان','القائد','الوزير','المستشار','الإمبراطور','الدوق','المحافظ'],LD=['ليمونيا','موزستان','برتقاليا','فراولستان','بطيخستان','تفاحيا','عنبستان','كيويستان','مانجوستان','خوخستان'];
function thumb(s){const c=document.createElement('canvas');c.width=48;c.height=80;const x=c.getContext('2d');x.fillStyle='#e0661a';x.fillRect(4,52,10,18);x.fillRect(34,52,10,18);x.fillStyle='#ffa31a';x.fillRect(18,68,12,10);
x.fillStyle=s[1];x.fillRect(14,18,20,52);x.strokeStyle='#000';x.lineWidth=2;x.strokeRect(14,18,20,52);x.fillStyle='#3b8a30';x.beginPath();x.moveTo(14,18);x.lineTo(34,18);x.lineTo(24,2);x.fill();
x.fillStyle=s[2];x.font='bold 11px Arial';x.textAlign='center';x.save();x.translate(24,44);x.rotate(-Math.PI/2);x.fillText('LOOM',0,4);x.restore();return c.toDataURL()}
function skRow2(){const r=document.createElement('div');r.style.cssText='display:flex;gap:6px;flex-wrap:wrap;justify-content:center;max-width:340px;font-size:12px;max-height:36vh;overflow:auto;touch-action:pan-y';
const bs='font-weight:700;font-size:12px;padding:5px 8px;border:2px solid #3b6e12;border-radius:10px;box-shadow:none;color:#222;';
const draw=()=>{r.innerHTML='<div style="width:100%">🪙 '+coins+'</div>';
SK.forEach((s,i)=>{const b=document.createElement('button'),o=own.includes(i);thm[i]=thm[i]||thumb(s);b.innerHTML='<img src="'+thm[i]+'" height="52"><br>'+(cur===i?'✔ ':'')+s[0]+(o?'':'<br>🪙'+s[3]);b.style.cssText=bs+'background:'+(cur===i?'#ffe14a':'#fff');
b.onclick=e=>{e.stopPropagation();if(o)cur=i;else if(coins>=s[3]){coins-=s[3];own.push(i);cur=i}else return;skin(cur);sv();draw()};r.appendChild(b)});
r.insertAdjacentHTML('beforeend','<div style="width:100%">⬆️ ترقيات</div>');
UP.forEach(u=>{const b=document.createElement('button'),l=up[u[0]],c=40+30*l;b.textContent=u[1]+' '+l+'/10'+(l>=10?'':' 🪙'+c);b.style.cssText=bs+'background:#cfe8ff';
b.onclick=e=>{e.stopPropagation();if(l>=10||coins<c)return;coins-=c;up[u[0]]++;sv();draw()};r.appendChild(b)})};draw();return r}
function leader(w,i){const c=[0x1f3a5f,0x7a1a1a,0x2b2b2b,0x3b6e12,0x5a2a7a][i%5],g=new THREE.Group();part(g,new THREE.BoxGeometry(2.4,3,1.6),c,0,1.5,0);part(g,new THREE.SphereGeometry(1.2,10,8),0xffd9a8,0,3.9,0);part(g,new THREE.BoxGeometry(.5,1.6,.2),0xe0382a,0,1.8,.85);
for(const s of[-1,1]){part(g,new THREE.SphereGeometry(.18,6,4),0x111111,s*.45,4.1,1);part(g,new THREE.BoxGeometry(.6,2.2,.6),c,s*1.6,2.2,0)}
const h=i%4;if(h===0)part(g,new THREE.CylinderGeometry(.9,1.1,.8,8),0xf2c230,0,5.2,0);else if(h===1){part(g,new THREE.CylinderGeometry(.8,.8,1.4,10),0x111111,0,5.4,0);part(g,new THREE.CylinderGeometry(1.4,1.4,.15,10),0x111111,0,4.8,0)}else if(h===2)part(g,new THREE.BoxGeometry(2.2,.5,1.6),0x3b8a30,0,5.1,0);else part(g,new THREE.BoxGeometry(2,.9,2),0x7a1a1a,0,5.2,0);
g.scale.setScalar(1.7);g.position.set(0,2.3,2);w.add(g)}
function vla(x,z){const t=new THREE.Group();part(t,new THREE.BoxGeometry(11,4,7),0xf5f1e8,0,0,0);part(t,new THREE.BoxGeometry(11.6,.5,7.6),0x333333,0,2.3,0);part(t,new THREE.BoxGeometry(8,1.8,.2),0x5ab4e6,0,.3,3.6);part(t,new THREE.BoxGeometry(6,.2,4),0x2ab4f0,0,-1.9,6.5);part(t,new THREE.BoxGeometry(1.6,1.6,.2),0xffe14a,0,4.1,0).rotation.z=Math.PI/4;
t.userData.r=6;t.userData.hp=2;t.position.set(x,H(x,z)+2,z);t.rotation.y=Math.atan2(-x,-z);mkr(t,9);return t}
function stf(x,z){const t=new THREE.Group();part(t,new THREE.BoxGeometry(2,3.2,1.4),0xff3b8a,0,1.6,0);part(t,new THREE.SphereGeometry(1.1,10,8),0xffd9a8,0,3.9,0);part(t,new THREE.BoxGeometry(2,.5,.3),0x111111,0,4.1,.95);part(t,new THREE.BoxGeometry(1,1,.2),0xffe14a,0,2.2,.8).rotation.z=Math.PI/4;part(t,new THREE.ConeGeometry(1,1.6,5),0xffe14a,0,5.6,0);
t.userData.r=3.5;t.position.set(x,H(x,z)+.2,z);t.rotation.y=Math.atan2(-x,-z);mkr(t,8);return t}
let best=0,rk0=1,tot=1;try{best=+localStorage.getItem('lrb')||0}catch(e){}
const NM=new Map([[tank,'🛡️ دبابات'],[apc,'🚙 مدرعات'],[hse,'🏠 بيوت'],[gov,'🏛️ مبانٍ حكومية'],[lnc,'🚀 منصات'],[plane,'✈️ طائرات'],[vil,'😈 أشرار'],[vla,'🏰 فلل'],[stf,'⭐ نجوم']]);
const WN=['🌴 الجزيرة الخضراء','🏜️ الصحراء الذهبية','❄️ أرض الثلج','🌙 وادي الليل','🌋 أرض الحمم','🍭 عالم الحلوى'];
function show2(t,s,btn,fn){const wi=Math.floor((lvl-1)/10),ty={};for(const o of targets){const k=o.userData.nm||'👑 الهدف الرئيسي';ty[k]=(ty[k]||0)+1}
let st='';if(t.indexOf('✅')===0){const q=rockets/Math.max(1,rk0),n=q>=.5?3:q>=.25?2:1;st='<div class="stars">'+'★'.repeat(n)+'<i>'+'★'.repeat(3-n)+'</i></div>';best=Math.max(best,lvl);try{localStorage.setItem('lrb',best)}catch(e){}}
ov.innerHTML='<div class="card"><div class="top"><span>🍋 المرحلة <b>'+lvl+'</b></span><span>🌍 '+cname(wi)+'</span></div><div class="wn">'+WN[wi%6]+'</div><h1>'+t+'</h1>'+st+'<p>'+s+'</p>'+(targets.length?'<div class="obj">'+Object.keys(ty).map(k=>'<span>'+k+' ×'+ty[k]+'</span>').join('')+'</div>':'')+'<div class="meta"><span>🚀 '+rockets+'</span><span>⭐ '+score+'</span><span>🏆 '+best+'</span></div><button>'+btn+'</button></div>';
const cd=ov.querySelector('.card'),dt=document.createElement('details');dt.innerHTML='<summary>🛒 المتجر والترقيات</summary>';dt.appendChild(skRow2());cd.appendChild(dt);const d2=document.createElement('details');d2.innerHTML='<summary>🔧 ورشة الصاروخ (صمّم صاروخك)</summary>';d2.appendChild(ws());cd.appendChild(d2);cd.appendChild(empire());const ms=document.createElement('div');ms.className='obj';ms.innerHTML='<span>'+(t.indexOf('✅')===0?(misDone?'✅ ':'❌ '):'📋 ')+mis.txt+' (🪙'+mis.r+')</span>';cd.insertBefore(ms,cd.querySelector('button'));
const cr=document.createElement('small');cr.textContent='صُنعت من LEMO_Loom';cd.appendChild(cr);
if(lvl%5){const sk=document.createElement('small');sk.style.cssText='text-decoration:underline;padding:8px';sk.textContent='⏭ قفز 25 مرحلة';sk.onclick=e=>{e.stopPropagation();lvl+=25;start()};cd.appendChild(sk)}
ov.style.display='flex';ov.scrollTop=0;ov.querySelector('button').onclick=e=>{e.stopPropagation();fn()}}
const clouds=[];for(let i=0;i<16;i++){const c=new THREE.Group(),n=3+Math.floor(R()*3);for(let j=0;j<n;j++){const m=new THREE.Mesh(new THREE.BoxGeometry(8+R()*8,3+R()*2,6+R()*4),new THREE.MeshBasicMaterial({color:0xffffff,fog:false,transparent:true,opacity:.85}));m.position.set(j*7-n*3,R()*2,R()*4);c.add(m)}c.position.set((R()-.5)*500,55+R()*35,(R()-.5)*500);scene.add(c);clouds.push(c)}
let eng=null,mute=false;
function engStart(){if(mute||!ac)return;try{if(ac.state==='suspended')ac.resume();engStop();const o=ac.createOscillator(),o2=ac.createOscillator(),g=ac.createGain(),f=ac.createBiquadFilter(),ns=ac.createBufferSource(),nf=ac.createBiquadFilter(),ng=ac.createGain(),nb=ac.createBuffer(1,ac.sampleRate*2,ac.sampleRate),dd=nb.getChannelData(0);
for(let i=0;i<dd.length;i++)dd[i]=R()*2-1;ns.buffer=nb;ns.loop=true;nf.type='bandpass';nf.frequency.value=900;nf.Q.value=.6;ng.gain.value=.35;
o.type='sawtooth';o.frequency.value=60;o2.type='square';o2.frequency.value=30;f.type='lowpass';f.frequency.value=500;g.gain.value=0;g.gain.linearRampToValueAtTime(.2,ac.currentTime+.3);
o.connect(f);o2.connect(f);f.connect(g);ns.connect(nf);nf.connect(ng);ng.connect(g);g.connect(ac.destination);o.start();o2.start();ns.start();eng={o,o2,ns,g,nf}}catch(e){}}
function engStop(){try{if(eng){const e=eng;eng=null;e.g.gain.cancelScheduledValues(ac.currentTime);e.g.gain.setTargetAtTime(0,ac.currentTime,.05);setTimeout(()=>{try{e.o.stop();e.o2.stop();e.ns.stop()}catch(x){}},300)}}catch(e){}}
const mu=document.createElement('div');mu.textContent='🔊';mu.style.cssText='position:absolute;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);left:12px;font-size:22px;background:rgba(0,0,0,.55);border:3px solid #ffe14a;padding:4px 8px;z-index:3;box-shadow:3px 3px 0 #000;color:#fff';
mu.onclick=e=>{e.stopPropagation();mute=!mute;mu.textContent=mute?'🔇':'🔊';if(mute)engStop();else if(st==='fly')engStart()};document.body.appendChild(mu);
document.addEventListener('visibilitychange',()=>{if(document.hidden)engStop();else if(st==='fly')engStart()});
let city=false;
const BR=[['ليمو ماركت',0x2fa84f],['برجر لوم',0xe0661a],['لوم تك',0x2a6fd6],['صن كولا',0xd62a2a],['فروت شوب',0xd62aa8]];
function sgn(t,txt,y){const L=lab(txt);L.position.y=y;t.add(L)}
function fin(t,x,z,y,r,mh,nm){t.userData.r=r;t.position.set(x,H(x,z)+y,z);t.rotation.y=Math.atan2(-x,-z);mkr(t,mh);sgn(t,nm,mh+4);return t}
function bank(x,z){const t=new THREE.Group();part(t,new THREE.BoxGeometry(11,5,8),0xd8d2c0,0,0,0);part(t,new THREE.BoxGeometry(12,.6,9),0x777777,0,2.8,0);part(t,new THREE.CylinderGeometry(4.5,4.5,1.2,3).rotateX(-Math.PI/2).scale(1,.4,1),0xd8d2c0,0,3.7,4.2);
for(let i=0;i<4;i++)part(t,new THREE.CylinderGeometry(.5,.5,5,8),0xffffff,-3.6+i*2.4,0,4.4);return fin(t,x,z,2.5,5,8,'بنك ليمو')}
function sky(x,z){const t=new THREE.Group(),h=22+R()*12;part(t,new THREE.BoxGeometry(7,h,7),[0x8aa4c0,0x9aa0a8,0x7a8fa8][Math.floor(R()*3)],0,0,0);
for(let k=0;k<5;k++)part(t,new THREE.BoxGeometry(7.2,.8,7.2),0x2a3b52,0,-h/2+4+k*(h-6)/4.4,0);part(t,new THREE.BoxGeometry(.3,5,.3),0xcccccc,0,h/2+2.5,0);
boxes.push({x,z,w:7,d:7,top:H(x,z)+h-2});t.userData.r=8;t.position.set(x,H(x,z)+h/2-2,z);mkr(t,h/2+6);return t}
function rest(x,z){const t=new THREE.Group();part(t,new THREE.BoxGeometry(8,3.5,6),0xf0c890,0,0,0);for(let i=0;i<5;i++)part(t,new THREE.BoxGeometry(1.6,.4,2.2),i%2?0xffffff:0xd62a2a,-3.2+i*1.6,1.1,3.9);part(t,new THREE.BoxGeometry(5,1.6,.2),0x5ab4e6,0,0,3.05);return fin(t,x,z,1.8,4.5,7,'مطعم')}
function shop(x,z){const t=new THREE.Group();part(t,new THREE.BoxGeometry(13,4,8),0xe8e0d0,0,0,0);part(t,new THREE.BoxGeometry(9,2.4,.2),0x5ab4e6,0,-.2,4.05);part(t,new THREE.BoxGeometry(13.6,.6,8.6),0x2a6fd6,0,2.3,0);return fin(t,x,z,2,6,8,'سوق ليمو')}
function brand(x,z){const b=BR[Math.floor(R()*BR.length)],t=new THREE.Group();part(t,new THREE.BoxGeometry(8,4,6),0xf5f5f5,0,0,0);part(t,new THREE.BoxGeometry(8.4,1.2,6.4),b[1],0,2.4,0);part(t,new THREE.BoxGeometry(5,2,.2),b[1],0,-.2,3.05);return fin(t,x,z,2,5,8,b[0])}
function conf(x,z){const t=new THREE.Group();part(t,new THREE.BoxGeometry(16,4,10),0xdfe6ee,0,0,0);part(t,new THREE.SphereGeometry(4.5,10,6,0,6.283,0,1.571),0x7fc4ee,0,2,0);part(t,new THREE.BoxGame Source: صاروخ ليمو
Creator: ChromeFlame24
Libraries: three
Complexity: moderate (139 lines, 20.1 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: game-chromeflame24-mwoih4o5" to link back to the original. Then publish at arcadelab.ai/publish.