deepgame / lib /consts.ts
dylanebert
update syntax
7cbcb40
export const defaultHTML = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Game</title>
<style>
body { margin: 0; padding: 0; overflow: hidden; background: #000; font-family: Arial, sans-serif; }
#game-canvas { width: 100vw; height: 100vh; display: block; }
</style>
</head>
<body>
<canvas id="game-canvas"></canvas>
<world canvas="#game-canvas" sky="0x87ceeb">
<!-- Main Platform -->
<static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="0x90ee90"></static-part>
<!-- Floating Platforms -->
<static-part pos="5 2 0" shape="box" size="3 0.5 3" color="0x8b4513"></static-part>
<static-part pos="-5 4 0" shape="box" size="3 0.5 3" color="0x8b4513"></static-part>
<static-part pos="0 6 -5" shape="box" size="3 0.5 3" color="0x8b4513"></static-part>
<!-- Dynamic Balls -->
<dynamic-part pos="0 8 0" shape="sphere" color="0xff4500" mass="1" restitution="0.8"></dynamic-part>
<dynamic-part pos="2 8 2" shape="sphere" color="0xffd700" mass="1" restitution="0.8"></dynamic-part>
<dynamic-part pos="-2 8 -2" shape="sphere" color="0x00ff00" mass="1" restitution="0.8"></dynamic-part>
<!-- Dynamic Boxes -->
<dynamic-part pos="3 5 -2" shape="box" size="1 1 1" color="0x4169e1"></dynamic-part>
<dynamic-part pos="-3 5 2" shape="box" size="1 1 1" color="0xff1493"></dynamic-part>
<!-- Moving Platform -->
<kinematic-part pos="0 3 5" shape="box" size="4 0.5 2" color="0x9370db">
<tween target="body.pos-x" from="-5" to="5" duration="4" ease="sine-in-out" loop="ping-pong"></tween>
</kinematic-part>
<!-- Player spawns automatically with orbit camera -->
</world>
<script src="https://cdn.jsdelivr.net/npm/shalloteer@latest/dist/cdn/shalloteer.standalone.iife.js"></script>
<script>
// Custom game system for collectibles
const CollectibleSystem = {
update: (state) => {
// Game logic can be added here
}
};
// Run game with custom system
GAME.withSystem(CollectibleSystem).run();
</script>
</body>
</html>
`;