Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createBacteries( count )
- local bacteria = {}
- bacteria.count = count
- bacteria.speed = 10
- bacteria.bacteriesInGroup = 10
- -- public functions
- function bacteria:sendArmy(persent, sourceColony, destColony)
- local groups = math.ceil((bacteria.count * persent / 100) / bacteria.bacteriesInGroup)
- local army = math.ceil(bacteria.count * persent / 100)
- bacteria.count = bacteria.count - army
- local distance = math.sqrt(math.pow((sourceColony.x - destColony.x),2) + math.pow((sourceColony.y - destColony.y),2))
- ...
- ...
Add Comment
Please, Sign In to add comment