forked from team-sg/hero-mark-2
break the camera from its chains, and give it competition!
This commit is contained in:
parent
d57194597e
commit
91df8e2e39
3 changed files with 36 additions and 20 deletions
13
objects/respawn_point.gd
Normal file
13
objects/respawn_point.gd
Normal file
|
@ -0,0 +1,13 @@
|
|||
extends Area2D
|
||||
|
||||
export var match_h = false
|
||||
export var match_v = true
|
||||
|
||||
func _on_RespawnPoint_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
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 - 10
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue