src/genericunits.cpp
// unintelligentLinealMove ******
// This method executes the movement of a generic unit, if it's required
// that the unit should be moved to a given point

unintelligentLinealMove
This method executes the movement of a generic unit, if it's required
that the unit should be moved to a given point
unintelligentLinealMove This method executes the movement of a generic unit if it ' s required that the unit should be moved to a given point
bool unintelligentLinealMove(
	genericUnitStruct* unit)
{
	long double gx=unit->goingToPointX;
	long double gy=unit->goingToPointY;
	if (!unit->goingToPoint) return true;
	double sx=unit->speedX;
	double sy=unit->speedY;
	if (unit->isPosRelative) {
		gx+=gameWorld.xCamera;
		gy+=gameWorld.yCamera;
	}
	if (ABS(gx-unit->x)<=ABS(sx)) {
		unit->x=gx;
	}else{
		unit->x+=sx;
	}
	if (ABS(gy-unit->y)<=ABS(sy)) {
		unit->y=gy;
	}else{
		unit->y+=sy;
	}
	if (unit->x==gx && unit->y==gy) {
		unit->goingToPoint=false;
		unit->speedX=0;
		unit->speedY=0;
	}
	return true;
}
bool unintelligentLinealMove ( genericUnitStruct * unit ) { long double gx = unit -> goingToPointX ; long double gy = unit -> goingToPointY ; if ( ! unit -> goingToPoint ) return true ; double sx = unit -> speedX ; double sy = unit -> speedY ; if ( unit -> isPosRelative ) { gx += gameWorld . xCamera ; gy += gameWorld . yCamera ; } if ( ABS ( gx - unit -> x ) <= ABS ( sx ) ) { unit -> x = gx ; } else { unit -> x += sx ; } if ( ABS ( gy - unit -> y ) <= ABS ( sy ) ) { unit -> y = gy ; } else { unit -> y += sy ; } if ( unit -> x == gx && unit -> y == gy ) { unit -> goingToPoint = false ; unit -> speedX = 0 ; unit -> speedY = 0 ; } return true ; }
unintelligentLinealMove 
This method executes the movement of a generic unit, if it's required
that the unit should be moved to a given point
unintelligentLinealMove This method executes the movement of a generic unit if it ' s required that the unit should be moved to a given point
// enemy unit to move
 // point to go coordinates
 // check it's necessary to move the unit such way
 // we assume the speed has already been calculated
 // for desired speed
 // check for relative coordinates
 // move it, checking that it doesn't surpass the destine
 // point
 // x movement
 // reached the desired point
 // move it
 // y movement
 // reached the desired point
 // move it
 // point reached?
 // all ok
