source-code/
break-the-web
Public
javascript31 lines952 B
const gameBox = document.getElementById('game-box');
const letterM = document.getElementById('letter-m');
const playText = document.getElementById('play-text');
let isGameStarted = false;
gameBox.addEventListener('click', () => {
if (isGameStarted) return;
isGameStarted = true;
// 1. Box membesar jadi arena (800x500px)
gameBox.classList.add('expanded');
// Ngescroll otomatis biar box-nya pas di tengah layar
setTimeout(() => {
gameBox.scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300);
// 2. Teks memudar, M siap jatuh
setTimeout(() => {
playText.classList.add('fade-out-text');
letterM.style.color = '#00ff00';
letterM.classList.add('falling');
}, 1200);
// 3. M mendarat, siap jadi uler
setTimeout(() => {
console.log("Mekanik game dimulai! Ular siap beraksi.");
// Logika nyalain Phaser lu masuk di sini nanti
}, 2800);
});About
Interact with the web page itself using HTML5 Drag-and-Drop to pull inputs and images directly into the Phaser physics engine. Alter the website state through bi-directional communication between React and Phaser, unlocking a glitchy horror mode. The game is built using React, Phaser 3, Zustand for state management, and Vanilla CSS.
linknre.codes
ReactPhaser 3TypeScriptZustandVite