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

Allow & document customisation of Player and Goober #34

Closed
cassidyjames opened this issue Jan 17, 2025 · 1 comment · Fixed by #55
Closed

Allow & document customisation of Player and Goober #34

cassidyjames opened this issue Jan 17, 2025 · 1 comment · Fixed by #55
Assignees
Labels
Engineering Code or Godot-specific work

Comments

@cassidyjames
Copy link
Member

I gave this a try:

  1. Copied the textures into my own world's folder and recolored them to purple
  2. Copied the TileSet.tres into my own world's folder, renamed it to Purple.tres for clarity
  3. In the TileSet bottom panel I selected each tile and set its texture to my recolored version
  4. In each of my levels' TileMapLaer node, I set the Tile Set (in the Inspector panel) to my Purple.tscn

Image

This worked, but only for the wall tiles; the others (player, goober, explosion) showed the correct tiles in the level designer, but still use the original tiles when playing the game.

Image

This appears to be due to how the tilemap is used as a placeholder to be replaced by the "live" scenes, around here:

func MapStart():
for pos in Map.get_used_cells():
var id = Map.get_cell_source_id(pos)
match id:
TILE_WALL:
# Use random wall tile from 3×3 tileset to make levels look less repetitive
var atlas = Vector2(randi_range(0, 2), randi_range(0, 2))
Map.set_cell(pos, TILE_WALL, atlas)
TILE_PLAYER:
# Add live player to the scene
var inst = ScenePlayer.instantiate()
inst.position = Map.map_to_local(pos) + Vector2(4, 0)
self.add_child(inst)
# Remove static player tile from the tile map
Map.set_cell(pos, -1)
TILE_GOOBER:
# Add live goober to the scene
var inst = SceneGoober.instantiate()
inst.position = Map.map_to_local(pos) + Vector2(4, 1)
NodeGoobers.add_child(inst)
# Remove static goober tile from the tile map
Map.set_cell(pos, -1)

Originally posted by @cassidyjames in #30

@cassidyjames cassidyjames added the Engineering Code or Godot-specific work label Jan 17, 2025
@manuq
Copy link
Contributor

manuq commented Jan 24, 2025

@cassidyjames the alternative way to do it for the Gobbers or Player is to instantiate the scenes. You can duplicate the Player.tscn and Goober.tscn into your own world folder and customize these scenes. Then instantiate them instead of painting the tiles.

@dsd dsd changed the title Custom tilesets not used in live game Allow & document customisation of Player and Goober Jan 24, 2025
manuq added a commit that referenced this issue Jan 24, 2025
This is a recommended setting for low resolution pixel-art games.
Exactly this case. It will help instantiating Player or Goober scenes
directly into the canvas.

Helps #34
@manuq manuq self-assigned this Jan 24, 2025
manuq added a commit that referenced this issue Jan 24, 2025
Explain the alternative to paint goobers or player.

#34
@dsd dsd closed this as completed in #55 Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Code or Godot-specific work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants