Guest User

Untitled

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. function createBacteries( count )
  2.     local bacteria = {}
  3.     bacteria.count = count
  4.     bacteria.speed = 10
  5.     bacteria.bacteriesInGroup = 10
  6.    
  7.     -- public functions
  8.     function bacteria:sendArmy(persent, sourceColony, destColony)
  9.         local groups = math.ceil((bacteria.count * persent / 100) / bacteria.bacteriesInGroup)
  10.         local army = math.ceil(bacteria.count * persent / 100)
  11.         bacteria.count = bacteria.count - army
  12.        
  13.         local distance = math.sqrt(math.pow((sourceColony.x - destColony.x),2) + math.pow((sourceColony.y - destColony.y),2))
  14. ...
  15. ...
Add Comment
Please, Sign In to add comment