Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | GiannisG |
I’m trying to make a prototype for a turn-based dungeon crawler. I say “turn-based” because I want the player to move tile by tile without necessarily using a _process function.
I’ve looked at the 2D Role Playing Game Demo. I notice it uses the TileMap for every game entity; walls, player, NPCs, and items. Before moving to the next tile (of the given direction), the game checks whether it contains a wall tile or another object, using the TileMap.get_cellv()
function.
So far so good.
But what if I wanted to have a Node2D (or some subclass of that) for NPCs/enemies and items, instead of the counter-intuitive TileMap? I know the target position, but I can’t seem to find a way of checking whether that position contains a node (while I can check a TileMap for a specific tile).
And I’m guessing many will suggest I use _process and Area2Ds and signals. But I’d rather not, since it’s a game where everything moves step by step and I want to keep it to the bare essentials.
Note: Area2Ds only seem to work asynchronously (aka with signalling), while get_overlapping_areas()
doesn’t work properly either.
Thank you both. I ended up using the TileMap as used in the demo and it’s not that bad after all.
GiannisG | 2023-01-10 10:32