0 votes

Hi, I'm making a simple 2D platformer game (quite new to Godot). I have one Tilemap for all the platforms and another Tilemap for spike tiles. I want my player to restart (die) when touching the spike tiles however the only way I can think of getting it work is to make each spike an individual Node and duplicate with an Area2D to detect the collision but this seems a very slow process and would leave me with so many spike Nodes with the amount of spikes in the game!

Is there a way to allow my player to interact with the Tilemap so I can place spikes quickly and easily on my map as a Tile?

Thank you!

Godot version 3.2.3
in Engine by (16 points)

1 Answer

0 votes

I'm afraid you are facing the problem in the right way: individual nodes with Area2D to detect collision. The "trick" here is creating a scene with the spikes and use some special tiles in your tilemap to spawn them in the ready() or _entertree(): functions.

You could try this addon (I've never use it and I don't know the author): https://github.com/qtip/tile-spawner/tree/master/addons/tile_spawner

by (70 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.