|
keys = {u:0, l:0, r:0, d:0};
X = -1.5;
Z = 18;
RY = 0;
W.clearColor("8af");
for(i = 0; i < 10; i++)
for(j = 0; j < 10; j++)
W.billboard({size:3,x:(i-5)*5,z:(j-5)*5,t:tree,ns:1});
W.mario({n:"M",size:1,x:X,y:-.9,z:Z,t:"mario",s:1});
W.camera({g:"M",y:.5,z:-2.5});
W.plane({g:"camera",size:100,b:"3d2",z:-100,y:-50,ns:1});
setInterval(()=>{
if(keys.u || keys.d)
W.move({
n:"M",
z: Z += (keys.d - keys.u) * Math.cos(RY*Math.PI/180) / 40,
x: X += (keys.d - keys.u) * Math.sin(RY*Math.PI/180) / 40
});
if(keys.r || keys.l) RY += (keys.l - keys.r)/5, W.move({n:"M", ry: RY});
});
|