STEAM GROUP
game development help gamedevhelp
STEAM GROUP
game development help gamedevhelp
7
IN-GAME
66
ONLINE
Founded
28 May, 2015
Language
English
ItsJustTony 9 May, 2016 @ 11:37pm
{GM}Taaaaanks!
I am currently working on an arena based tank game and I for the life of me can not figure out how to work out an aggro range. I want the tanks to path to a player but not get so close that it pushes the player out of the screen/room. How would I go about doing this?

reference code:
image_angle = point_direction(x, y, obj_player.x, obj_player.y);
mp_potential_step(obj_player.x + 15, obj_player.y +15, moveSpeed, true);
< >
Showing 1-1 of 1 comments
kris40k 14 Jul, 2016 @ 10:15pm 
var tooClose = <somenumber>; // your judgement here, obviously enough to prevent collision/bumping var rangeToPlayer = point_distance(x, y, obj_player.x, obj_player.y); if ( rangeToPlayer <= tooClose ) { // set your objects speed to zero or change their behaviour state to stop closing distance }
Last edited by kris40k; 14 Jul, 2016 @ 10:17pm
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: 9 May, 2016 @ 11:37pm
Posts: 1