You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.1 KiB

<!DOCTYPE html>
<html>
<head>
<title>I love X Engine</title>
<style>
body {
margin: 0;
padding: 0;
background: #000;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: Arial, sans-serif;
}
#game {
text-align: center;
}
.welcome-screen {
opacity: 1;
transition: opacity 0.5s;
}
.welcome-screen.hidden {
opacity: 0;
}
h1 {
font-size: 48px;
margin-bottom: 20px;
}
.start-message {
font-size: 24px;
color: #aaa;
}
.hidden {
display: none;
}
</style>
</head>
<body>
<div id="game">
<div id="welcome" class="welcome-screen">
<h1>Welkom bij I love X!</h1>
<p class="start-message">Druk op SPATIE om te beginnen</p>
</div>
</div>
<script>
const { ipcRenderer } = require('electron');
// Game state
let gameState = 'welcome';
// Handle keyboard input
document.addEventListener('keydown', (event) => {
if (event.code === 'Space' && gameState === 'welcome') {
startGame();
}
});
// Start game
function startGame() {
gameState = 'playing';
document.getElementById('welcome').classList.add('hidden');
ipcRenderer.send('game:start');
}
// Listen for engine events
ipcRenderer.on('engine:ready', (event, data) => {
console.log('Engine ready:', data);
});
ipcRenderer.on('game:started', () => {
console.log('Game started');
});
ipcRenderer.on('game:paused', () => {
console.log('Game paused');
});
</script>
</body>
</html>