I already have the monsters moving using arrays. Now i want to create the torrent that will shoot and fire at the enemies. I know how to make the torrent point and fire at 1 enemy but not when there is multiple enemies. Also, it would be nice to understand the concept of
and code for being able to place and not place an object in a specific position. Well actually want to know the easiest way with less bugs for i could probably do it the long,hard,confusing way.
You have lots of choices, for example, you can aim for the closest one using co-ordinates, or you could aim for the monster with the lowest variable suffix. Think of the methods you want to use and I will tell you how to code it.
In order to do this you will need to enumerate all of the monsters, gathering all of thier co-ordinates. Then subtract them from the turrets position, wrapping the subtraction in the abs() command, in order to obtain a positive number. After this you will need to select the monster that produce the lowest numbers from these calculations, as it will be the closest.
lol i understand what i have to do, but i don't quite understand how to do it; like how to set it up, could it be possible to give me an example or make something and post on a sight so i could watch it i usually do better with visual things any way lol or you can just type the code, but the way i type code is different than other peoples so it might be confusing lol. A link would also be helpful but then again I'm here because i can't find anything helpful other places.
P.S. Ty for comments and help lol
This post has been edited by blaze32707: 03 November 2008 - 03:28 PM