예제 #1
0
 void spawnEnemy(MotherShipComponent motherShip, PositionComponent position)
 {
     getFactory().CreateEnemyByType(motherShip.droneType, position.pos.x, position.pos.y, motherShip.droneHealth, 0, 0, motherShip.droneDamage, motherShip.droneSpeed)
         .ReplaceVelocity(getRandomizedStartVelocity(motherShip.droneSpeed))
         .AddFindTarget(CollisionTypes.Player)
         .AddHomeMissile(0.5f, motherShip.droneSpeed, CollisionTypes.Player);
 }
예제 #2
0
 void increaseSpawnCountAndRemoveIfMaxed(Entity e, MotherShipComponent motherShip)
 {
     if (++motherShip.spawnedDronesCount >= motherShip.droneSpawnLimit)
         e.isDestroyEntity = true;
 }