src/collisions.cpp
// bulletUnitHit *******
// This method is called every time a bullet unit is hit by anything.
// Then, it's responsible of making all the necessary changes in the
// touched bullet unit.

bulletUnitHit
This method is called every time a bullet unit is hit by anything.
Then, it's responsible of making all the necessary changes in the
touched bullet unit.
bulletUnitHit This method is called every time a bullet unit is hit by anything . Then it ' s responsible of making all the necessary changes in the touched bullet unit .
bool bulletUnitHit(
	vectorListNodeStruct<bulletUnitStruct>& bUnit,
	gameObjectPointerStruct& toucher)
{
	bool wasToucherAWall=false;
	if (bUnit.data.nowExploding) {
		return true;
	}
	switch (toucher.objectType) {
	case FILE_GAMEDATA_GAMEOBJECT_ENEMY:
		break;
	case FILE_GAMEDATA_GAMEOBJECT_PLAYER:
		break;
	case FILE_GAMEDATA_GAMEOBJECT_BULLET:
		break;
	case FILE_GAMEDATA_GAMEOBJECT_VIRTUALWALL:
		wasToucherAWall=true;
		break;
	}
	bUnit.data.currentFrame=
		getFrameIndexAndListByName("flameBulletExploding");
	bUnit.data.vFramesPassed=0;
	if (false) {
		bUnit.data.speedX=0;
		bUnit.data.speedY=0;
		bUnit.data.goingToPoint=false;
		bUnit.data.nowExploding=true;
	}else{
		bUnit.data.canCollideWithBullets=false;
		bUnit.data.canCollideWithEnemies=false;
		bUnit.data.canCollideWithPlayers=false;
		bUnit.data.goingToPointX=bUnit.data.x
			-(wasToucherAWall?200:70);
		bUnit.data.goingToPointY=0-
			(constructContainerFrame(&bUnit.data).h
			-constructContainerFrame(&bUnit.data).handlerY);
		bUnit.data.goingToPoint=true;
		if (bUnit.data.isPosRelative) {
			bUnit.data.goingToPointX-=gameWorld.xCamera;
			bUnit.data.goingToPointY-=gameWorld.yCamera;
		}
		setSpeedForLinealMove(&bUnit.data,
			bUnit.data.goingToPointX, bUnit.data.goingToPointY,
			260/double(desiredFramesPerSecond));
	}
	return true;
}
bool bulletUnitHit ( vectorListNodeStruct < bulletUnitStruct > & bUnit , gameObjectPointerStruct & toucher ) { bool wasToucherAWall = false ; if ( bUnit . data . nowExploding ) { return true ; } switch ( toucher . objectType ) { case FILE_GAMEDATA_GAMEOBJECT_ENEMY : break ; case FILE_GAMEDATA_GAMEOBJECT_PLAYER : break ; case FILE_GAMEDATA_GAMEOBJECT_BULLET : break ; case FILE_GAMEDATA_GAMEOBJECT_VIRTUALWALL : wasToucherAWall = true ; break ; } bUnit . data . currentFrame = getFrameIndexAndListByName ( " " ) ; bUnit . data . vFramesPassed = 0 ; if ( false ) { bUnit . data . speedX = 0 ; bUnit . data . speedY = 0 ; bUnit . data . goingToPoint = false ; bUnit . data . nowExploding = true ; } else { bUnit . data . canCollideWithBullets = false ; bUnit . data . canCollideWithEnemies = false ; bUnit . data . canCollideWithPlayers = false ; bUnit . data . goingToPointX = bUnit . data . x - ( wasToucherAWall ? 200 : 70 ) ; bUnit . data . goingToPointY = 0 - ( constructContainerFrame ( & bUnit . data ) . h - constructContainerFrame ( & bUnit . data ) . handlerY ) ; bUnit . data . goingToPoint = true ; if ( bUnit . data . isPosRelative ) { bUnit . data . goingToPointX -= gameWorld . xCamera ; bUnit . data . goingToPointY -= gameWorld . yCamera ; } setSpeedForLinealMove ( & bUnit . data , bUnit . data . goingToPointX , bUnit . data . goingToPointY , 260 / double ( desiredFramesPerSecond ) ) ; } return true ; }
bulletUnitHit 
This method is called every time a bullet unit is hit by anything.
bulletUnitHit This method is called every time a bullet unit is hit by anything .
// enemy unit which was hit
 // the one who touched the enemy unit
 // it's already exploding, it hasn't to do anything different
 // once it's touched
 // do the sound of the bullet hitting an enemy
 /*		makeSoundFlameBulletHitEnemy();*/ // There is nothing to do here
 // There is nothing to do here
 // do the sound of the bullet hitting a wall
 /*		makeSoundFlameBulletHitWall();*/ // remember it was a wall
 // Now it's time for this bullet to start his explosion.
 // continue auto framing
 // The exploding bullet can't move but can keep colliding
 // the unit is now marked as 'exploding'
 // we want the bullet to stop colliding with other units
 // the bullet now goes away
 // correct the coordinates to be relative
 // set the speed for going to such point
 // all ok
