Money Tree Idle
by RocketPanther21119 lines1.5 KB
<!DOCTYPE html>
<html>
<body style="
margin:0;
background:linear-gradient(#87CEEB,#55aa55);
font-family:sans-serif;
text-align:center;
overflow:hidden;
">
<h1 style="margin-top:20px;">
🌳 MONEY TREE IDLE 🌳
</h1>
<h2 id="money">
💰 Tiền: 1
</h2>
<h3 id="speed">
⚡ +1 tiền / giây
</h3>
<div id="tree"
style="
font-size:120px;
transition:0.3s;
">
🌱
</div>
<button onclick="upgrade()"
style="
font-size:25px;
padding:15px;
border:none;
border-radius:15px;
background:gold;
">
Nâng cấp cây 🌳
</button>
<script>
let money = 1;
let speed = 1;
let level = 1;
const moneyText =
document.getElementById("money");
const speedText =
document.getElementById("speed");
const tree =
document.getElementById("tree");
function updateUI(){
moneyText.innerText =
"💰 Tiền: " +
Math.floor(money);
speedText.innerText =
"⚡ +" + speed + " tiền / giây";
if(level >= 2) tree.innerText = "🌿";
if(level >= 5) tree.innerText = "🌳";
if(level >= 10) tree.innerText = "🎄";
if(level >= 20) tree.innerText = "✨🌳✨";
}
setInterval(()=>{
if(money < 1000000){
money += speed;
if(money > 1000000){
money = 1000000;
}
updateUI();
}
},100);
function upgrade(){
let cost = level * 100;
if(money >= cost){
money -= cost;
level++;
speed += level;
tree.style.transform =
"scale(" + (1 + level/20) + ")";
updateUI();
} else {
alert("Không đủ tiền!");
}
}
updateUI();
</script>
</body>
</html>Game Source: Money Tree Idle
Creator: RocketPanther21
Libraries: none
Complexity: moderate (119 lines, 1.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: money-tree-idle-rocketpanther21" to link back to the original. Then publish at arcadelab.ai/publish.