🎮ArcadeLab

TRASH GAME 3000

by BoldPenguin14
86 lines2.5 KB
▶ Play

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>TRASH GAME 3000</title>
<style>
*{box-sizing:border-box}
body{margin:0;background:#ff00aa;color:#fff;font-family:Comic Sans MS;text-align:center;overflow:hidden;touch-action:manipulation}
h1{font-size:29px;color:yellow;text-shadow:4px 4px red}
#game{height:65vh;background:#80ff00;border:9px dashed red;position:relative;overflow:hidden}
#player{position:absolute;font-size:55px;left:45%;top:65%;transition:.1s}
#potato{position:absolute;font-size:65px;left:40%;top:10%}
#score{font-size:25px;color:blue}
button{position:absolute;padding:18px;background:orange;color:red;border:5px solid purple;border-radius:40%;font-size:20px;font-weight:bold}
#move{bottom:10px;left:10px}
#jump{bottom:10px;right:10px}
#start{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%);background:black;padding:20px;z-index:5;border:5px solid yellow}
</style>
</head>
<body>
<h1>🗑️ TRASH GAME 3000</h1>
<div id="score">Score: 0 | IQ: -400</div>
<div id="game">
<div id="player">🧍</div>
<div id="potato">🥔</div>
<div id="start" onclick="begin()">START GAME 🤡</div>
</div>
<button id="move" onclick="move()">MOVE??</button>
<button id="jump" onclick="jump()">JUMP???</button>
<script>
let score=0,x=45,y=65,playing=false;
const p=document.getElementById("player");
const potato=document.getElementById("potato");
const game=document.getElementById("game");
function update(){
p.style.left=x+"%";
p.style.top=y+"%";
document.getElementById("score").textContent=
"Score: "+score+" | IQ: "+(Math.floor(Math.random()*-1000));
}
function begin(){
playing=true;
document.getElementById("start").style.display="none";
setInterval(()=>{
if(!playing)return;
score++;
potato.style.left=Math.random()*85+"%";
potato.style.top=Math.random()*80+"%";
if(Math.random()<.3){
document.body.style.background=["red","blue","lime","pink"][Math.floor(Math.random()*4)];
}
update();
},1000);
}
function move(){
if(!playing)return;
x+=(Math.random()>.5?15:-15);
if(x<0)x=90;if(x>95)x=5;
if(Math.random()<.3)score+=100;
update();
}
function jump(){
if(!playing)return;
y=Math.random()*75;
score+=Math.random()<.5?50:-100;
p.textContent=["🧍","🐸","💩","🦆","👽"][Math.floor(Math.random()*5)];
update();
}
game.addEventListener("touchstart",e=>{
if(playing&&e.target===game){
score+=Math.random()*10;
update();
}
});
setInterval(()=>{
if(playing&&Math.random()<.08){
alert("CONGRATULATIONS! YOU LOST!");
score+=500;
update();
}
},7000);
</script>
</body>
</html>

Game Source: TRASH GAME 3000

Creator: BoldPenguin14

Libraries: none

Complexity: moderate (86 lines, 2.5 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: trash-game-3000-boldpenguin14" to link back to the original. Then publish at arcadelab.ai/publish.