Skip to content

feat: Add sloped tiles for smooth terrain - #52

Draft
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
feature/smooth-terrain
Draft

feat: Add sloped tiles for smooth terrain#52
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
feature/smooth-terrain

Conversation

@google-labs-jules

Copy link
Copy Markdown

This change adds sloped tiles to the terrain to make it smoother and less blocky. It includes changes to the level generation, rendering, and physics to support the new tile types.


PR created automatically by Jules for task 8634068162566071779

This commit introduces sloped tiles to the terrain generation to create a smoother, less blocky feel.

- A new `Tile` class and `TileType` enum have been created to support different tile types, including solid blocks, empty space, and 45-degree slopes.
- The `LevelGenerator` has been updated to detect surface tiles and convert them to sloped tiles based on their neighbors.
- The `GreedyMesher` is now only used for the solid ground tiles below the surface, while the surface tiles (including slopes) are rendered as individual sprites. This allows for custom rendering and physics for the slopes.
- New textures for the sloped tiles are generated in `GameScene.js`.
- Custom slope physics has been added to `GameScene.js` to handle player movement on the sloped tiles. This is necessary because Phaser's Arcade Physics does not natively support slopes.
@google-labs-jules

Copy link
Copy Markdown
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

I will automatically address your feedback. For any comments you don't want me to act on, just include (aside).



For security, I will only act on instructions from the user who triggered this task for this pull request.

@vercel

vercel Bot commented Sep 16, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
disastersword Ready Ready Preview Comment Sep 16, 2025 1:57pm

This commit introduces sloped tiles to the terrain generation to create a smoother, less blocky feel.

- A new `Tile` class and `TileType` enum have been created to support different tile types, including solid blocks, empty space, and 45-degree slopes.
- The `LevelGenerator` has been updated to detect surface tiles and convert them to sloped tiles based on their neighbors.
- The `GreedyMesher` is now only used for the solid ground tiles below the surface, while the surface tiles (including slopes) are rendered as individual sprites. This allows for custom rendering and physics for the slopes.
- New textures for the sloped tiles are generated in `GameScene.js`.
- Custom slope physics has been added to `GameScene.js` to handle player movement on the sloped tiles. This is necessary because Phaser's Arcade Physics does not natively support slopes. The new implementation uses a velocity-based approach, which is more robust and less likely to conflict with the physics engine.
- Added tests for the new slope physics.
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.

0 participants