|
Post by sqidwarf on Jul 5, 2005 11:31:25 GMT -5
ok in the game im making there are more then one of the same instances in each fight. (sometimes there might be 5 warriors) I cant figure out how to find the instance of an object with the most of a variable such as movement or maybe you could suggest another way to do this
|
|
|
Post by IsmAvatar on Jul 5, 2005 17:02:34 GMT -5
//fastest(obj) //by IsmAvatar //obj is an object or the keyword all //returns the instance id of obj with the highest speed
var big, ID; big = 0; ID = noone for (m = 0; m < instance_number(argument0); m += 1) { zz = instance_find(argument0,m) if zz.speed > big { big = zz.speed ID = zz } } return ID
|
|