13 lines
428 B
GDScript
13 lines
428 B
GDScript
extends Area2D
|
|
|
|
export var match_h = false
|
|
export var match_v = true
|
|
|
|
func _on_RespawnPoint_area_entered(area):
|
|
if area.is_in_group("player_hitbox"):
|
|
if Game.get_sector(global_position) != Game.get_sector(Game.respawn_point):
|
|
var player = area.get_parent()
|
|
Game.respawn_point = Vector2(
|
|
player.global_position.x if match_h else global_position.x,
|
|
player.global_position.y if match_v else global_position.y
|
|
)
|