Well I use alot the collision function and I use it for each type of entity i have . My question is: Is there a collide function that can include every entity that has a hitbox,insted of doing a collision for each type of entity(collide(“entity”,x,y))?
Collision function (with any type?)
DPbrad
(Brad Davies)
#2
I know you can do a test against multiple types using;
var e:Entity = WHATEVER YOUR ENTITY IS
if(e.collideTypes(["enemy","bomb","spikes"],e.x,e.y))
{
doWhatever
}
Ultima2876
(Ultima2876)
#4
Put the entities you want to collide into a Vector or array and then iterate over them with a for loop.
billy2000
(billy2000)
#5
well i allready made something almost like that …just whanted to know if there is a efficient way of doing that . Thx guys