Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

feat: Strike tile#19

Open
LautaroPetaccio wants to merge 5 commits intomasterfrom
feat/striked-tile
Open

feat: Strike tile#19
LautaroPetaccio wants to merge 5 commits intomasterfrom
feat/striked-tile

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 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.

1 participant