Skip to content

Implement top-down 2D letter collection game#2

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/setup-game-level-maps
Closed

Implement top-down 2D letter collection game#2
Copilot wants to merge 4 commits intomainfrom
copilot/setup-game-level-maps

Conversation

Copy link

Copilot AI commented Nov 26, 2025

Top-down 2D game where players collect letters to form words while avoiding enemies. Players must collect all letters for a level's word to unlock water crossing and reach the goal.

Changes

Core Game Engine

  • Game config: Arcade physics, 720x480 canvas (45x30 tiles @ 16px), pixel art mode
  • TMX Parser (src/game/utils/TmxParser.js): Parses Tiled map files, extracts tile layers and object groups
  • Camera: 4x zoom with smooth player following, bounded to map dimensions

Gameplay (src/game/scenes/Game.js)

  • Player movement via WASD/Arrow keys with walk cycle animation (frames 268-274)
  • Tile layer rendering: Ground, Obstacles (collision), Water (blocking), Goal
  • Letter collection from object layer with word progress tracking
  • Water crossing unlocks when word is complete; player switches to boat sprite (frame 190)
  • Enemies: bombs (stationary), hovercrafts (random movement) - contact triggers game over
  • 10 levels with words: AI, Git, Data, Merge, Commit, Branch, GitHub, Program, Copilot, Developer

Scenes

  • Preloader: Loads spritesheet, TMX files, creates animations
  • MainMenu: Splash screen with click/Enter/Space to start
  • GameOver: Win/lose states with level reached

Screenshot

Original prompt

This section details on the original issue you should resolve

<issue_title>Game set-up</issue_title>
<issue_description>This game is a top-down 2D game where a player collects letters to form words while avoiding enemies. A player, for each level, has to collect the letters of a word. Once they get all of the letters for a given level, they are able to cross a body of water to reach the next level. The "finish line" on each level is across the water, and once they cross it, they go to the next level.

Sprites

The maps are .tmx files (from Tiled, named level1.tmx through level10.tmx) in src/game/maps.

The spritesheet is also in src/game/maps, called spritesheet.png. It is full of 16x16 sprites packed together, it is a 25x11 grid.

Map structure

Every map for each level has:

  • A ground layer
  • An obstacle layer that the player can collide into, but not cross
  • A water layer that the player can only cross when they have all of the letters in the word for the level
  • A goal layer that the player has to go to once they get all of the letters (and once they do, that unlocks the next level)
  • A letter layer with all of the letters that the player has to collect
  • An enemy layer with bombs and hovercrafts (bombs are stationary enemies, hovercrafts move around randomly up, down, left, and right)
  • A spawn layer where the player spawns for that level

Sprites not in the map

The player "walk cycle" sprite is in the sprite sheet in the seven bottom-most tiles on the sheet (as in, the last row of the sheet, in the far right 7 columns).

When the player crosses the water, they should use the boat sprite at row 8, column 16.

Navigation

A player uses arrow keys or WASD to move around the map.

Splash screen

Use the current temporary splash screen for now.</issue_description>

<agent_instructions>The existing Phaser code is not sacred. Rewrite whatever you need.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 26, 2025 01:34
Co-authored-by: cassidoo <1454517+cassidoo@users.noreply.github.com>
Co-authored-by: cassidoo <1454517+cassidoo@users.noreply.github.com>
Copilot AI changed the title [WIP] Set up game levels with maps and sprites Implement top-down 2D letter collection game Nov 26, 2025
Copilot AI requested a review from cassidoo November 26, 2025 02:25
Copy link
Owner

@cassidoo cassidoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good so far. We should also have the camera zoomed in so that the player can't see the whole map as they play. Maybe zoomed in by 4.

@copilot

import { parseTmx, getLayer, getObjectGroup, extractLetterFromName } from '../utils/TmxParser';

// Words for each level
const LEVEL_WORDS = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You made up these words and shouldn't have. The words are already in the map and the README, and you can see them here:

AI
Git
Data
Merge
Commit
Branch
GitHub
Program
Copilot
Developer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b2208e9. Updated LEVEL_WORDS to use the correct words from the README: AI, Git, Data, Merge, Commit, Branch, GitHub, Program, Copilot, Developer.

…llowing

Co-authored-by: cassidoo <1454517+cassidoo@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 26, 2025

This generally looks good so far. We should also have the camera zoomed in so that the player can't see the whole map as they play. Maybe zoomed in by 4.

@copilot

Added 4x camera zoom in b2208e9. The camera now follows the player with setZoom(4) and startFollow(), with bounds set to the map dimensions. UI elements use setScrollFactor(0) to stay fixed on screen.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • gryzor.co
    • Triggering command: /usr/local/bin/node node log.js build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@netlify
Copy link

netlify bot commented Nov 26, 2025

Deploy Preview for code-wave-game ready!

Name Link
🔨 Latest commit b2208e9
🔍 Latest deploy log https://app.netlify.com/projects/code-wave-game/deploys/692690e6ae0aab000850f182
😎 Deploy Preview https://deploy-preview-2--code-wave-game.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI requested a review from cassidoo November 26, 2025 05:35
@cassidoo cassidoo closed this Nov 26, 2025
@cassidoo cassidoo deleted the copilot/setup-game-level-maps branch November 26, 2025 06:50
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.

Game set-up

2 participants