Yes... but remember that if you've just got ellipsoid collisions, checking distances is all Blitz is doing anyway. I don't think you'd really be saving any time doing it yourself.
Code to make enemies fire would look something like this:
The code to move all bullets and check them against enemies would look like this:
Code to make enemies fire would look something like this:
; in your main loop... For E.Enemy = each Enemy if (Rnd(0,100) < 10) FireEnemyGun(E) Next ; outside the main loop... Function FireEnemyGun(E.Enemy) ; Make a new bullet B.Bullet = new Bullet B\Entity = CopyEntity(BulletSprite) ; Copy the firing enemy's position and rotation PositionEntity(B\Entity, EntityX(E\Entity), EntityY(E\Entity), EntityZ(E\Entity)) RotateEntity(B\Entity, EntityPitch(E\Entity), EntityYaw(E\Entity), EntityRoll(E\Entity)) ; Move bullet away from enemy so it doesn't blow itself up MoveEntity(B\Entity, 0, 0, 1.1) End Function
The code to move all bullets and check them against enemies would look like this:
For B.Bullet = each Bullet MoveEntity(B, 0, 0, 0.1) ; Move bullet forwards on its Z axis For E.Enemy = each Enemy If (EntityDistance(B\Entity, E\Entity) < 1) ExplodeEnemy(E) FreeEntity(B\Entity) Delete(B) End If Next Next