How do I check for player spawns

Get help using Construct 2

Post » Mon Feb 29, 2016 2:11 am

I have a single screen map with game play similar to Super Smash Bros.

When players die they need to respawn at one of the set spawn points. I need to check if a player is close or already spawned on that point and spawn the dead player in a different location.

I have hidden sprites representing the spawn points.

I've tried doing this two ways without success.

1. Putting all the players into a family, then checking on respawn each respawn sprite for no line of sight to the players family.

2. Using the turret behavior and checking for no target in range.

neither of these worked, does anyone know a good way to implement this?
B
4
Posts: 4
Reputation: 208

Post » Mon Feb 29, 2016 8:01 am

Use the distance function to check. If distance(Spawn.X, Spawn.Y, Player.X, Player.Y) <= MIN_ALLOWED_DISTANCE then spawn. Just experiment with MIN_ALLOWED_DISTANCE a little.
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170


Return to How do I....?

Who is online

Users browsing this forum: David181, nahima, Shenkai the ssj and 23 guests