—
BaconSwagg
youtube.com/watch
code:
for each impbase:
is not boolean working
is not boolean targetted
pick become tile, become tile dig=1
becometile. pick nearest imp base.
(so if the imps dont have a job, they arent currently moving to something, and the tile is selected to be dug)
becometile.x+radius*((impbase.x-becometile.x)/sqrt((impbase.X-becometile.X)^2+(impbase.Y-becometile.Y)^2))
impbase.Uidcheck: set to become tile UID
set boolean working true
set boolean targetted true.
the path finding code is explained in the video. i had another topic where i explain it. but, it just checks the center point of the tile, and calculates the closest point on the circumfrance to the imp.
on arrived. impcheckuid>0 set digging boolean true.
then the dig code is just do an animation based on a timer. and do damage to the becometile that has UID= impbase.uid check.
just want to add, in the video, the imps stop when they cant reach the block to dig. they will continue to do other jobs when unselecting the block.
priority is to drop off gold they have when full. dig, and then claim ground