Locale variable "CurrentBiggestDistance"
Locale variable "MostFarUID"
OnDeath
------for each spawnpoint
-------------for each enemy
------------------------distance(spawnpoint.x, spawnpoint.y, enemy.x, enemy.y) > CurrentBiggestDistance : Set CurrentBiggestDistance to distance(spawnpoint.x, spawnpoint.y, enemy.x, enemy.y) AND set MostFarUID to enemy.UID
-------Pick spawnpoint UID= MostFarUID : Spawn Player
-------[No condition] : Set CurrentBiggestDistance to 0 AND Set MostFarUID to -1
gl!