Dev: Dynamic Tile Map Rendering for 2D Game #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example map with Grass, Water and Wood
We implemented dynamic tile map rendering for our 2D game. We introduced a
TILE_TYPES
object that defines different types of tiles along with their corresponding colors.The
drawTile
function was updated to use this object to render tiles on the canvas based on the provided tile map data.To showcase this feature, we created a new tile map representing a grass area with a river. The map is loaded and rendered using the Canvas component, which also includes the player and their movement logic.
This dynamic tile map rendering enables us to create diverse and customizable game worlds, making our 2D game more engaging and immersive.
The commit lays the foundation for further expansion of the game world with different tile types, adding depth and complexity to the gameplay experience.
The addition of dynamic map loading and rendering will greatly enhance the gameplay and level design possibilities of our 2D game. This marks an exciting milestone in the development of our project and sets the stage for further advancements in the game's environment and mechanics.