cloudllm 0.15.6

A batteries-included Rust toolkit for building intelligent agents with LLM integration, multi-protocol tool support, multi-agent orchestration, and MentisDB-backed durable memory.
Documentation
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Atari Breakout - RALPH Edition</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { background: #000; display: flex; justify-content: center; align-items: center; min-height: 100vh; font-family: 'Courier New', monospace; color: #fff; }
        #gameContainer { text-align: center; }
        canvas { border: 2px solid #333; display: block; margin: 0 auto; background: #111; }
        #hud { margin-top: 10px; font-size: 14px; }
    </style>
</head>
<body>
    <div id="gameContainer">
        <canvas id="gameCanvas" width="800" height="600"></canvas>
        <div id="hud">SCORE: 0 | LEVEL: 1 | LIVES: 3</div>
    </div>
    <script>
        // === GAME STATE ===
        const canvas = document.getElementById('gameCanvas');
        const ctx = canvas.getContext('2d');
        const STATES = { MENU: 0, PLAYING: 1, PAUSED: 2, GAME_OVER: 3, LEVEL_COMPLETE: 4 };
        let gameState = STATES.MENU;
        let score = 0, lives = 3, level = 1;

        // === PADDLE ===
        const paddle = { x: 350, y: 560, width: 100, height: 12, speed: 7, color: '#4488ff' };
        let keys = {};
        document.addEventListener('keydown', e => keys[e.key] = true);
        document.addEventListener('keyup', e => keys[e.key] = false);

        // === BALL ===
        let balls = [{ x: 400, y: 300, dx: 4, dy: -4, radius: 6, color: '#fff' }];

        // === BRICKS ===
        const BRICK_COLORS = { 1: '#ffff00', 2: '#00ff00', 3: '#4488ff', 4: '#ff8800', 5: '#ff0000' };
        let bricks = [];
        function initBricks() {
            bricks = [];
            for (let r = 0; r < 5; r++) {
                for (let c = 0; c < 11; c++) {
                    let hp = Math.min(5, r + 1);
                    bricks.push({ x: 10 + c * 71, y: 50 + r * 28, width: 65, height: 22, hp: hp, maxHp: hp, alive: true });
                }
            }
        }
        initBricks();

        // === GAME LOOP ===
        function update() {
            if (gameState !== STATES.PLAYING) return;
            if (keys['ArrowLeft'] || keys['a']) paddle.x = Math.max(0, paddle.x - paddle.speed);
            if (keys['ArrowRight'] || keys['d']) paddle.x = Math.min(canvas.width - paddle.width, paddle.x + paddle.speed);
            for (let ball of balls) {
                ball.x += ball.dx; ball.y += ball.dy;
                if (ball.x - ball.radius < 0 || ball.x + ball.radius > canvas.width) ball.dx *= -1;
                if (ball.y - ball.radius < 0) ball.dy *= -1;
                if (ball.y + ball.radius > canvas.height) { lives--; ball.x = 400; ball.y = 300; ball.dy = -4; if (lives <= 0) gameState = STATES.GAME_OVER; }
                if (ball.dy > 0 && ball.y + ball.radius >= paddle.y && ball.x >= paddle.x && ball.x <= paddle.x + paddle.width) {
                    ball.dy *= -1; let hitPos = (ball.x - paddle.x) / paddle.width; ball.dx = 8 * (hitPos - 0.5);
                }
                for (let brick of bricks) {
                    if (!brick.alive) continue;
                    if (ball.x + ball.radius > brick.x && ball.x - ball.radius < brick.x + brick.width &&
                        ball.y + ball.radius > brick.y && ball.y - ball.radius < brick.y + brick.height) {
                        ball.dy *= -1; brick.hp--; score += 10;
                        if (brick.hp <= 0) brick.alive = false;
                    }
                }
            }
            if (bricks.every(b => !b.alive)) { level++; initBricks(); gameState = STATES.LEVEL_COMPLETE; }
            document.getElementById('hud').textContent = `SCORE: ${score} | LEVEL: ${level} | LIVES: ${lives}`;
        }

        function draw() {
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            if (gameState === STATES.MENU) { ctx.fillStyle = '#fff'; ctx.font = '36px Courier New'; ctx.fillText('ATARI BREAKOUT', 240, 280); ctx.font = '18px Courier New'; ctx.fillText('Click or press SPACE to start', 230, 330); return; }
            if (gameState === STATES.GAME_OVER) { ctx.fillStyle = '#f00'; ctx.font = '48px Courier New'; ctx.fillText('GAME OVER', 240, 300); ctx.font = '18px Courier New'; ctx.fillStyle = '#fff'; ctx.fillText(`Final Score: ${score}`, 310, 350); return; }
            if (gameState === STATES.LEVEL_COMPLETE) { ctx.fillStyle = '#0f0'; ctx.font = '36px Courier New'; ctx.fillText(`LEVEL ${level} COMPLETE!`, 220, 300); ctx.font = '18px Courier New'; ctx.fillStyle = '#fff'; ctx.fillText('Click or press SPACE to continue', 220, 350); return; }
            ctx.fillStyle = paddle.color; ctx.fillRect(paddle.x, paddle.y, paddle.width, paddle.height);
            for (let ball of balls) { ctx.beginPath(); ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2); ctx.fillStyle = ball.color; ctx.fill(); }
            for (let brick of bricks) { if (!brick.alive) continue; ctx.fillStyle = BRICK_COLORS[brick.hp] || '#fff'; ctx.fillRect(brick.x, brick.y, brick.width, brick.height); ctx.strokeStyle = '#333'; ctx.strokeRect(brick.x, brick.y, brick.width, brick.height); }
        }

        function gameLoop() { update(); draw(); requestAnimationFrame(gameLoop); }
        document.addEventListener('click', () => { if (gameState === STATES.MENU || gameState === STATES.LEVEL_COMPLETE) gameState = STATES.PLAYING; });
        document.addEventListener('keydown', e => { if (e.code === 'Space') { if (gameState === STATES.MENU || gameState === STATES.LEVEL_COMPLETE) gameState = STATES.PLAYING; else if (gameState === STATES.PLAYING) gameState = STATES.PAUSED; else if (gameState === STATES.PAUSED) gameState = STATES.PLAYING; }});
        gameLoop();
    </script>
</body>
</html>