Arcade Games
Jarvis includes a collection of classic arcade games that run directly in terminal panes as interactive HTML5 canvases.Available Games
Asteroids
Classic space shooter with vector graphics
Tetris
Block-stacking puzzle game with score tracking
Minesweeper
Logic puzzle with hidden mines
Pinball
Physics-based pinball simulation
Doodle Jump
Vertical platformer with tilt controls
Subway Surfers
Endless runner inspired by Subway Surfers
Draw
Freehand drawing canvas
Video Player
Simple video playback in pane
Launching Games
Via Command Palette
- Press
Cmd+K(or your configured keybind) - Type “game” to filter
- Select a game from the list
Via Keybinds
Configure custom keybinds injarvis.toml:
Programmatic Launch
Game Details
Asteroids
Controls:- Arrow keys: Rotate and thrust
- Space: Shoot
- R: Restart after game over
- Neon vector graphics with glow effects
- Progressive difficulty
- Score and lives tracking
- Particle effects
jarvis-rs/assets/panels/games/asteroids.html
Tetris
Controls:- Left/Right: Move piece
- Up: Rotate
- Down: Soft drop
- Space: Hard drop
- P: Pause
- Classic NES-style gameplay
- Line clear animations
- Level progression
- High score persistence
jarvis-rs/assets/panels/games/tetris.html
Minesweeper
Controls:- Left click: Reveal cell
- Right click: Flag mine
- Double click: Chord (reveal neighbors)
- Beginner: 9×9, 10 mines
- Intermediate: 16×16, 40 mines
- Expert: 30×16, 99 mines
jarvis-rs/assets/panels/games/minesweeper.html
Pinball
Controls:- Z: Left flipper
- M: Right flipper
- Space: Launch ball
- Matter.js physics engine
- Bumpers, targets, and ramps
- Multiball mode
- Tilt detection
jarvis-rs/assets/panels/games/pinball.htmljarvis-rs/assets/panels/games/pinball.jsjarvis-rs/assets/panels/games/pinball.css
Doodle Jump
Controls:- Arrow keys or A/D: Move left/right
- Auto-jump on platform contact
- Infinite vertical scrolling
- Moving platforms
- Springs and trampolines
- Score tracking
jarvis-rs/assets/panels/games/doodlejump.html
Subway Surfers
Controls:- Arrow keys: Move and jump
- Space: Jump
- Lane-based endless runner
- Obstacles and coins
- Speed increases over time
- Distance tracking
jarvis-rs/assets/panels/games/subway.html
Draw
Controls:- Mouse: Draw freehand
- Color picker: Change brush color
- Size slider: Adjust brush size
- Clear button: Reset canvas
- Smooth brush strokes
- Customizable colors and sizes
- Export to image
jarvis-rs/assets/panels/games/draw.html
Video Player
Controls:- Play/Pause button
- Seek bar
- Volume control
- MP4, WebM, OGG
- H.264, VP8, VP9 codecs
jarvis-rs/assets/panels/games/videoplayer.html
Game Architecture
All games run as WebView panels:Game Loading
WhenOpenGame action is dispatched:
- Check if game HTML exists in assets
- Create new pane with
PaneKind::WebView - Load game URL:
jarvis://localhost/games/{game}.html - Game initializes in isolated WebView context
Game State
Each game manages its own state:- Score, level, lives in JavaScript
- LocalStorage for high scores
- Canvas rendering via
requestAnimationFrame
No IPC Required
Games are self-contained HTML/JS/CSS:- No Rust backend interaction
- Pure client-side rendering
- Keyboard events handled in WebView
Adding Custom Games
1. Create Game HTML
Add file tojarvis-rs/assets/panels/games/:
2. Add to Asset Registry
Games are automatically discovered from the assets directory. No registration needed.3. Launch via Action
Example: Simple Pong
jarvis-rs/assets/panels/games/pong.html and launch with:
Best Practices
Performance
- Use
requestAnimationFramefor smooth 60 FPS - Limit canvas size to avoid overdraw
- Cache static elements
- Use sprite atlases for textures
Input Handling
Responsive Sizing
Score Persistence
jarvis-rs/assets/panels/games/*.html- Game assets served via
jarvis://localhostprotocol
Games run in isolated WebView contexts with full HTML5 Canvas API access. No special permissions required.