Skip to content

Fix demo game using wrong content for one tile. #5762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Janzert
Copy link

@Janzert Janzert commented Apr 23, 2025

I noticed while playing with the demo app that the sliding puzzle game didn't seem to recognize a correctly solved puzzle. It seemed to be 'one off', where it wanted the blank tile in the bottom right corner but the content for that corner was actually in one of the two adjacent tiles. After much too long investigating, but happily learning a bit about textual in the process, I finally found the content was getting set incorrectly because it was using the tile current position to set the content, but the tile had already moved once in the initial shuffle.

The fix is quite simple using Tile.start_position, instead of Tile.position when setting the tile's scroll position.

Checklist

  • No new or modified functions / classes, so no docstring updates.
  • No documentation changes needed. The game just solves correctly.
  • Trivial demo app fix so changelog item is probably not needed either.

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.

1 participant