I'll create a Pokémon Yellow-style game with the classic Game Boy Color screen format. Let me plan this carefully:
- Game Boy Color screen dimensions (160x144 pixels, scaled up)
- Pallet Town as the first city
- Opening scene - player in their room
- Meeting Professor Oak (Carvalho)
- Rival Gary encounter and battle
- Tile-based movement system
- Classic Pokémon Yellow aesthetics
Let me start building this step by step.
Now let me create all the game files. I'll start with the constants and types:
Now let me create the maps:
Now let me create the pixel art renderer:
Let me fix the import issues:
Now let me create the main game engine:
Now create the main App component:
Now let me update the CSS:
Let me build and check for errors:
The project builds successfully. Now let me test by reviewing the game logic and fix some potential issues I noticed. Let me review the map transition logic and make sure the player can properly walk through doors:
I see that the map transitions check for going out of bounds but some transitions rely on the player trying to walk into a door tile which is already set as a collision. Let me fix the transition logic - the player should step ON the transition tile (door/stairs):
I see a key issue: the doors/stairs have collision set to true in some maps but the transition checks for the player trying to walk INTO those tiles. The transitions will fire even though the player can't actually step there. However, the player will never reach those tiles because collision prevents them. The approach of checking targetX/targetY against out-of-bounds works for exits but not for doors that are within the map.
The fix: For indoor maps where the player walks to the edge (stairs at row 6, door at row 6), the transitions should trigger when the player tries to step beyond the map boundaries or onto the transition tiles. Let me fix the collision maps and transition logic:
Now I need to make the door/stairs tiles walkable for transition purposes. The door tiles need to NOT be collision-blocked. Let me update the collision maps:
The collision for stairs at row 6, col 3 is false in player_room - good. The door at row 6, col 3 in house_downstairs is false - good. But the player at row 5 trying to walk down to row 6 needs to trigger transition. Let me trace through the logic more carefully.
Actually the issue is that when the player is at (3, 5) in player_room and presses down, targetY = 6. The stairs tile at (3, 6) has collision false, so the player CAN walk there. But checkMapTransition also fires with the same target. The transition will start while the player is moving. Let me fix this by having transitions trigger when the player ARRIVES at the transition tile, not when they start moving:
Now I need to split the transition logic. Some transitions trigger when walking INTO a blocked tile (doors on outside of buildings), and others when arriving at a walkable tile (stairs, exits). Let me restructure:
Now let me replace the old checkMapTransition with two methods:
Now I need to make sure the stairs tile at player_room row 6 is walkable (collision false) - it already is. And the door at house_downstairs row 6 is walkable - it already is. But the door tiles on Pallet Town should remain collision=true since we handle them in the "blocked" check. Let me verify:
Good - DOOR is NOT in the collision list for Pallet Town. That means door tiles (player's house door at [10][5] and lab doors at [15][9], [15][10]) are walkable. But actually we WANT them to be collision-blocked from outside since we handle them in checkMapTransitionBlocked. Let me add DOOR to the collision list:
Now let me also ensure the oak_lab door tiles (row 9, cols 4 and 5) are walkable for exiting:
Good - oak_lab door tiles at row 9, cols 4 and 5 have collision false, so the player can walk onto them to trigger the exit.
Now let me also handle the pallet town exit location better. When transitioning from oak_lab, we go to pallet_town at position (9, 16). But row 16 is trees. Let me fix:
I see the issue. When exiting Oak's lab to pallet_town, position (9, 16) is trees. The lab door is at position row 15 on the outside. When exiting, the player should appear right below the door. But the path goes up to row 15 where the doors are. The player should appear at (9, 15) or below - but 15 is also a door (blocked). Let me change the exit position. The player's house appears at door position (5, 10), and the path at row 11 is walkable. The lab door is at row 15. The path in front is row 14. But wait, the lab roof overwrites the path:
Looking at lines 134-137, the roof overwrites rows 12-13 for x=7..12. And the path was set at rows 12-13 for x=9,10 (lines 108-111). The roof overwrites AFTER the path is set. So the path at (9,12), (10,12), (9,13), (10,13) is overwritten by ROOF_TOP and ROOF respectively. That means there's no walkable path leading to the lab door!
Let me fix the map to create a proper path to the lab:
Now the lab is at rows 11-14 instead of 12-15. The path at rows 12-13 (for x=9,10) will be overwritten by ROOF, but the path at row 14 (horizontal path to lab) is still there but now contains WALL. Let me also fix the horizontal path and the vertical path to the lab:
Now update the transition coordinates for the lab. Lab doors are now at row 14:
Also update the exit from lab to appear at row 15 (now a walkable path):
Now I also need to fix the exit from house_downstairs. The player exits to pallet_town at (5, 11). The player's house door is at map position (5, 10) - that's a DOOR tile, now collision-blocked. The path is at (5, 11) which is walkable. Good.
But there's still the sign at (8, 11) which may conflict with the path. Let me check: sign is at map[11][8]. The horizontal path for player's house goes from x=4 to x=9 at row 11. So the sign at (8,11) is overwritten by the path. Let me move the sign:
Wait, but row 12 is now ROOF for x=8. Let me move the sign somewhere better:
Now let me also ensure the main vertical path connects properly. The path goes from row 2 to row 15 (the code says for (let y = 2; y < 16; y++)). But the lab at rows 11-14 for x=9,10 overwrites some of these path tiles with building tiles. The roof at row 11 for x=7..12 and row 12 for x=7..12 will overwrite path tiles at x=9,10 for rows 11 and 12.
The issue is: the building construction happens AFTER the path is laid. So the path at (9,11), (10,11), (9,12), (10,12) etc. gets overwritten. But we need a path around the lab. Let me restructure - have the main path go down to where the lab starts, then have a path in front of the lab:
Actually, looking at the real Pallet Town layout, the lab is at the bottom, and you approach it from above. The path goes down and connects. Let me just make sure there's a continuous walkable path. The main path goes from y=2 to y=15 at x=9,10. The lab's roof and walls overwrite this at y=11..14. But the player approaches from above (y=10 going down), so they walk on the path at (9,10)/(10,10), then below that is the lab roof at (9,11) - which is collision=true.
The player needs to be able to walk around the lab. Let me add a path alongside:
I see the problem clearly now. The lab's ROOF_TOP is placed at row 11 for x=7..12. This overwrites the horizontal paths to the houses (row 11, x=7..9 was PATH from the player's house path, and x=10..12 was PATH from the rival's house path).
Let me completely restructure the Pallet Town map to be more faithful and avoid conflicts:
Now update the collision map to match the new 20x20 dimensions:
Now update the pallet_town map dimensions and NPC positions:
Now update the engine transition coordinates to match the new map layout:
Now update the blocked transition for entering player's house. The door is now at (5, 7):
Now update the lab entrance. Lab doors are at (9,16) and (10,16):
Update the exit from lab to appear at path in front of lab (17, 9):
Let me build and test:
It builds. Now let me trace through the game flow one more time to make sure everything works:
- Intro: Press Enter 7 times to go through intro screens → transitions to player_room
- Player Room: Player at (3, 4). Walk down to (3, 6) → stairs → transitions to house_downstairs
- House Downstairs: Player at (4, 2). Can talk to mom at (5, 4). Walk to (3, 6) → door → transitions to pallet_town at (5, 8)
- Pallet Town: Player at (5, 8) on the path. Walk north towards Route 1 at (9, 2) → Oak appears dialog → oak_invited flag set
- Walk to lab at (9, 17) then up to (9, 16) → DOOR tile blocked → enters lab at (4, 8)
- Oak's Lab: Lab scene plays. Player gets Pikachu. Gary challenges → battle starts
- Battle: Player fights Gary's Eevee with Pikachu
- After Battle: Dialog, then free roam
Wait, there's an issue. When the player exits the house to pallet_town at (5, 8), position (5, 8) is a PATH tile (from the horizontal path at row 8 going x=4..9). But actually, looking at the map again, the path goes from x=4 to x=9 (exclusive since x < 10), so (5, 8) should be PATH.
However, I also placed map[8][7] = T.MAILBOX which would make (7, 8) a mailbox. That's fine - it's the mailbox next to the player's house.
Let me also verify the path leads from the houses to the lab. From row 8 (house area), the vertical path at x=9,10 continues down to the lab area. The lab is at rows 13-16. The path at rows 9-12 should be intact since no buildings overlap there.
Let me also make the OAK interaction check on the sign tile work:
The game looks good. Let me now also add some important touch - I need to make sure the free_roam phase also uses updateOverworld:
Good - free_roam is in the switch case for updateOverworld. Let me also verify the render path handles all these phases:
The receive_pikachu, gary_challenge, and after_battle phases go through updateDialog but render will fall into the else branch which draws the overworld. Good.
Let me also handle the after_battle phase properly in the update switch:
Good. Now let me also review the updateAfterBattle method:
Good. Let me now also improve the fade effect which currently uses a dithering pattern that could be slow:
Let me optimize the fade effect to use canvas globalAlpha:
Let me also add the wakeup phase rendering and a subtle delay before movement is allowed:
Files built: index.html, src/game/constants.ts, src/game/types.ts, src/game/maps.ts, src/game/renderer.ts, src/game/engine.ts, src/App.tsx, src/index.css