Create a browser game with hand-motion controls using Kimi K2.5 | Alpha | PandaiTech

Create a browser game with hand-motion controls using Kimi K2.5

A guide to prompting the AI to code a game that uses a webcam to detect player finger movements.

Learning Timeline
Key Insights

Iterative Prompting Technique

AI might not produce perfect mechanics on the first try. Use descriptive feedback about what is wrong (such as UI issues or control smoothness) to help the AI refine the code incrementally.

Motion Control Tips

Ensure the room is well-lit so the webcam can track finger movements consistently, especially for actions requiring precision like pinching and aiming.
Prompts

Improving Pinch Control Logic

Target: Kimi K2.5
It doesn't matter where I pinch. As long as I pinch, it should drag the bubble down and start aiming.

Cleaning Up UI Elements

Target: Kimi K2.5
Remove the circle that tracks my hand. No need to show that.
Step by Step

Building a Hand-Tracking Game with AI Prompts

  1. Access the Kimi K2.5 platform and open a chat or AI code editor.
  2. Enter an initial prompt to generate a browser-based game that uses hand-tracking via webcam.
  3. Click the 'Generate' or 'Run' button to view the initial preview of the game.
  4. Test the game mechanics by performing a 'pinch' gesture in front of the webcam to observe object responses.
  5. Identify any issues with the interface or controls (e.g., objects only moving when touched precisely).
  6. Enter a follow-up prompt to fix the control logic so that 'pinching' anywhere on the screen activates the drag function.
  7. Provide additional instructions to remove distracting UI elements, such as the hand-tracking circle.
  8. Click the 'Start Game' button again to run the final version updated by the AI.

More from AI-Powered Coding & App Development

View All