- GameLauncher now displays only 4 games per page to keep menu in bounds - Added page navigation with page indicator (Page X/Y) - KEY0 navigates between pages and within page - KEY1 selects the highlighted game - Touch selection works on current page only - Helper methods: get_total_pages(), get_page_start_index(), get_page_end_index() - Updated both lib/ and emulator/ versions for consistency
4.2 KiB
4.2 KiB
basic1 Lua Games Implementation Plan
Overview
Build a collection of games for the basic1 homemade console, implementing them sequentially based on complexity and learning value.
Game List & Priority
Tier 1: Foundational (Start Here)
These teach core mechanics and are quick wins.
-
Flappy Bird ✅ DONE
- Mechanics: Gravity, collision, scrolling obstacles
- Complexity: Low
- Time Estimate: 1-2 hours
- Learning: Gravity physics, obstacle spawning, game states
- API Usage: Circle/rect drawing, gravity math, simple event handling
-
Breakout/Brick Breaker ✅ DONE
- Mechanics: Ball physics, paddle control, grid destruction
- Complexity: Low-Medium
- Time Estimate: 2-3 hours
- Learning: Collision detection, grid management, ball reflection angles
- API Usage: Rect grids, ball physics (similar to Pong), score tracking
-
Simon Says ✅ DONE
- Mechanics: Color sequence memory, pattern growing
- Complexity: Low
- Time Estimate: 1-2 hours
- Learning: State management, sequence arrays, timing
- API Usage: Rect drawing, button input, frame timing
Tier 2: Medium Difficulty (Build After Tier 1)
These combine mechanics and add complexity.
-
Tetris ✅ DONE
- Mechanics: Falling pieces, rotation, line clearing, gravity
- Complexity: Medium
- Time Estimate: 4-5 hours
- Learning: Grid-based movement, rotation matrices, collision
- API Usage: Rect grid system, complex state tracking, rapid updates
-
Asteroids ✅ DONE
- Mechanics: Spaceship control, rotation, projectiles, spawning
- Complexity: Medium
- Time Estimate: 3-4 hours
- Learning: Vector math, object pooling, spawn waves
- API Usage: Line drawing, rotation math, multiple entity management
Tier 3: Advanced (Polish & Challenge)
These build on previous learnings.
-
Memory/Matching Game ✅ DONE
- Mechanics: Tile flipping, pair matching, timer
- Complexity: Medium
- Time Estimate: 2-3 hours
- Learning: Hidden state management, animations
- API Usage: Grid layout, simple animations
-
Air Hockey ✅ DONE
- Mechanics: 2-player, ball physics, faster pace than Pong
- Complexity: Medium
- Time Estimate: 2-3 hours
- Learning: Improved physics, AI paddle (optional)
- API Usage: Ball physics refinement, smooth controls
Tier 4: Polish & Variants
Once core games work, extend with variants or features.
-
2048 ✅ DONE
- Mechanics: Grid merging, swipe logic, exponential growth
- Complexity: Medium
- Time Estimate: 3-4 hours
- Learning: Swipe detection, grid animation, merge logic
- API Usage: Grid rendering, touch gesture interpretation
-
Tic-Tac-Toe ✅ DONE
- Mechanics: Grid selection, AI opponent (minimax)
- Complexity: Low-Medium
- Time Estimate: 2-3 hours
- Learning: Game tree search, AI logic
- API Usage: Grid UI, event handling, win detection
-
Lunar Lander ✅ DONE
- Mechanics: Thrust, rotation, gravity, soft landing
- Complexity: Medium-High
- Time Estimate: 3-4 hours
- Learning: Advanced physics, control feel
- API Usage: Vector math, acceleration, fuel management
Implementation Strategy
Per Game:
- Write game file in
/Users/adolforeyna/Projects/basic1/games/lua_examples/ - Test locally if possible, or prepare for SD card deployment
- Document key mechanics in comments
- Update this plan with completion status
- Save daily progress to
memory/YYYY-MM-DD.md
Patterns to Reuse:
- State machine (MENU → PLAYING → GAME_OVER)
game.varsfor all stategame.set_frame_updates(true)for animation- Touch input handling (left/right screen halves for 2-player, center for single)
Testing Checklist (per game):
- Initializes without crashes
- Main gameplay loop works
- Input is responsive
- Collision detection accurate
- Score/state tracking correct
- Game over condition triggers
- Restart from menu works
Notes
- Monochrome display = simple visuals, focus on mechanics
- Touch controls are the primary input
- Frame-based animation keeps things smooth
- Each game builds on previous learnings
- Start simple, layer complexity progressively
Current Status: All 10 games complete. Ready for SD card deployment.