Skip to content
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

feat: Strike tile #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

feat: Strike tile #19

wants to merge 5 commits into from

Conversation

LautaroPetaccio
Copy link
Contributor

@LautaroPetaccio LautaroPetaccio commented Dec 30, 2022

This PR allows the drawing of tiles with a strike background if their strike property is set as true.
The rendering of the map is changed so when each layer is rendered, the strikethrough is rendered over each tile as well.

This procedure is done as follows:

  1. A pattern is created with strike lines.
  2. On each loop of the tile rendering process, if the tile has the strikethrough property as true, a rectangle with the shape of the tile is created in a Path2D region.
  3. Once the rendering of the tiles ends, a screen the size of the canvas is created using the pattern as the content.
  4. The rectangles with the sizes of the tiles are clipped through the strike canvas screen, producing a strike background for each tile.

The reason behind doing this procedure is that to have a common strike pattern, all of the tiles must share the same strike background as if not, the tiles' background wouldn't match with the backgrounds of their neighbors.

Screen Shot 2022-12-30 at 12 13 44

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