Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Improve "Simple tilemap example" #167

Merged
merged 1 commit into from
Jun 21, 2021
Merged

Improve "Simple tilemap example" #167

merged 1 commit into from
Jun 21, 2021

Conversation

BrettWitty
Copy link
Contributor

Following the request 1 in #163, I updated the example to use simpler defaults and the current API.

Changes include:

  • Using the default Tilemap to avoid calling spawn_chunk_at_point later.
  • Explained the use of HandleId::random::<TextureAtlas>
  • Put the tilemap up top and texture atlas work a little lower.
  • Expanded out Tile and explained all the data
  • Used insert_tile rather than set_tile

Following the request 1 in #163, I updated the example to use simpler defaults and the current API.

Changes include:
- Using the default Tilemap to avoid calling `spawn_chunk_at_point` later.
- Explained the use of `HandleId::random::<TextureAtlas>`
- Put the tilemap up top and texture atlas work a little lower.
- Expanded out Tile and explained all the data
- Used `insert_tile` rather than `set_tile`
@joshuajbouw joshuajbouw self-requested a review June 21, 2021 08:30
Copy link
Owner

@joshuajbouw joshuajbouw left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@joshuajbouw joshuajbouw merged commit d0962c7 into joshuajbouw:master Jun 21, 2021
@dwoznicki
Copy link

Just FYI, I think these lines

    // Which tile from the TextureAtlas
    sprite_index = 0,
    
    // Which z-layer in the Tilemap (0-up)
    sprite_order = 0,

should probably be

    // Which tile from the TextureAtlas
    sprite_index: 0,
    
    // Which z-layer in the Tilemap (0-up)
    sprite_order: 0,

And function tilemap.set_default_texture_atlas does not seem to exist for me. Perhaps it should be tilemap.set_texture_atlas?

@BrettWitty
Copy link
Contributor Author

Yep. My bad. I'll make the changes and push them.

joshuajbouw pushed a commit that referenced this pull request Jun 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants