Skip to content

Convert iOS Cogito game to JavaScript web version#6

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/convert-program-to-javascript
Draft

Convert iOS Cogito game to JavaScript web version#6
Copilot wants to merge 3 commits intomasterfrom
copilot/convert-program-to-javascript

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 7, 2026

Ported the iOS machine learning game to vanilla JavaScript for browser execution. Original game uses Cocos2D for iOS; web version uses HTML5 Canvas with no external dependencies.

Implementation

Core Files

  • index.html - UI shell with Canvas rendering, controls, settings panel, and real-time logging
  • game.js - Game engine (26KB) with physics, collision detection, and ML algorithms
  • WEB_README.md - Usage documentation

Machine Learning Algorithms

  • Q-Learning: Epsilon-greedy exploration with learning rate 0.4, discount factor 0.9
  • Decision Tree: Rule-based evaluation of state conditions
  • Shortest Route: Direct pathfinding to exit

Game Mechanics

  • Physics: Gravity-based movement, fall damage threshold, umbrella floating
  • Collision: Platform detection, hazard interactions (water, stampers, trapdoors)
  • State management: 60 FPS game loop with 4x speed multiplier options
  • Level system: 3 difficulty levels with distinct obstacle layouts

Configuration

  • Agents: 1-50 spawnable entities
  • Episodes: 1-50 training iterations
  • Speed: Slow/Normal/Fast/Ultra (1x-8x)
  • Algorithms: Switchable between Q-Learning/Decision Tree/Shortest Route

Screenshots

Initial game state with Level 1 layout:
Initial State

Training with Decision Tree algorithm:
Training Active

Usage

Open index.html directly in browser - no build process or server required.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 7, 2026 15:57
Co-authored-by: taylortom <1059083+taylortom@users.noreply.github.com>
Co-authored-by: taylortom <1059083+taylortom@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert program to JavaScript for web viewing Convert iOS Cogito game to JavaScript web version Feb 7, 2026
Copilot AI requested a review from taylortom February 7, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants