Position and Sit Markers
Goals
PositionMarker and SitMarker are visual aids that can be placed anywhere to help guide the player.
How it works
Both are Area2D
s with a sprite and some animations.
For PositionMarker
, it is only connected to the Area2D
's body_entered
signal, and once the player triggers it, the marker will hide and delete itself.
For SitMarker
, it is connected to both body_entered
and body_exited
signals, once the player enters its area, it will show a tooltip alert to press the Sit button, and when the player sits, the marker will hide and delete itself.
To use them, you just need to instance their scenes and position them where you want. To make it easier, every Level
has helper functions that you pass a position to it, and the level itself will place them:
add_position_marker(target_position: Vector2)
- returns void.add_sit_marker(target_position: Vector2)
- this one returns the sit marker itself, so that you can connect to itstree_exited
signal if you need to trigger something after the player sits.
For an example of usage of the SitMarker
, you can look at Part_NightTime.tscn
, we use it there to make Torion start telling the quest completed story once you sit by the fireplace.
With what script it communicates
None, though Room.gd
knows how to instance them, and Level.gd
forwards this to make it easier to use.