Skip to content
blikoor edited this page May 9, 2020 · 4 revisions

Home>Notes>Part-2

Part-2: The Piece scenes

Deviations

Piece.tscn ➨ Tile.tscn

  1. Make a new scene, use Node2D as the root node and name it 'Tile'.

  2. Add a child node of type Sprite, and change the Transform/Scale settings: (0.5, 0.5). Save the scene in the assets folder.


  1. Use TexturePacker to make a sprite sheet for the tiles, using PNG-8 texture format, reducing the sprite sheet file size by 52% (19KB to 9KB). Combine 'Blue Piece.png', 'Green Piece.png', 'Light Green Piece.png', 'Orange Piece.png', 'Pink Piece.png', 'Yellow Piece.png' and publish the sprite sheet named 'tiles.png' and the data file named 'tiles.tpsheet'.

  2. Copy 'tiles.png' and 'tiles.tpsheet' into the 'assets' folder within the FileSystem dock.


blue_piece.tscn ➨ BlueTile.tscn 5. Drag & drop 'Blue Piece.tres' ('res://assets/tiles.sprites' folder) to the texture of the sprite node. Save the scene as 'BlueTile.tscn' in the 'assets' folder.

green_piece.tscn ➨ GreenTile.tscn 6. Drag & drop 'Green Piece.tres' ('res://assets/tiles.sprites' folder) to the texture of the sprite node. Save the scene as 'GreenTile.tscn' in the 'assets' folder.

light_green_piece.tscn ➨ LightGreenTile.tscn 7. Drag & drop 'Light Green Piece.tres' ('res://assets/tiles.sprites' folder) to the texture of the sprite node. Save the scene as 'LightGreenTile.tscn' in the 'assets' folder.

orange_piece.tscn ➨ OrangeTile.tscn 8. Drag & drop 'Orange Piece.tres' ('res://assets/tiles.sprites' folder) to the texture of the sprite node. Save the scene as 'OrangeTile.tscn' in the 'assets' folder.

pink_piece.tscn ➨ PinkTile.tscn 9. Drag & drop 'Pink Piece.tres' ('res://assets/tiles.sprites' folder) to the texture of the sprite node. Save the scene as 'PinkTile.tscn' in the 'assets' folder.

yellow_piece.tscn ➨ YellowTile.tscn 10. Drag & drop 'Yellow Piece.tres' ('res://assets/tiles.sprites' folder) to the texture of the sprite node. Save the scene as 'YellowTile.tscn' in the 'assets' folder.

Clone this wiki locally