Thanks in advance.
Edited by Person2, 16 April 2012 - 04:32 AM.
Posted 16 April 2012 - 03:56 AM
Edited by Person2, 16 April 2012 - 04:32 AM.
Posted 16 April 2012 - 03:59 AM
var top_speed, inst; //declare 2 temporary variables.
inst=noone; //this is a reference to the fastest enemy
top_speed=0; //this is a reference to the top speed (so far!)
with (obj_enemy) //loop through the enemy objects
{
if (speed>top_speed) //check their speed...
{
inst=id; //if they have the top speed, store a reference to them in inst!
}
}
if instance_exists(inst) //always double check..
{
//inst is the fastest!!
//shoot him!!
}
Posted 16 April 2012 - 04:35 AM
top_speed = inst.speed;
Posted 16 April 2012 - 04:57 AM
0 members, 0 guests, 0 anonymous users