All pastes #553978 Raw Edit

jacob

public text v1 · immutable
·published 2007-06-09 23:25 UTC
rendered paste body
stock GetAheadCoords(Float:Fx, Float:Fy, Float:Fangle, direction, Float:units)
{
	switch (direction)
	{
	    case FORWARD:
	    {
	        upx = Fx - floatsin(Fangle * PI / 180) * units;
	        upy = Fy + floatcos(Fangle * PI / 180) * units;
	    	return 1;
		}
  		case BACK:
  		{
  		    upx = Fx + floatsin((Fangle) * PI / 180) * units;
  		    upy = Fy - floatcos((Fangle) * PI / 180) * units;
  		    return 1;
		}
		case LEFT:
		{
  		    upx = Fx - floatsin((Fangle) * PI / 180) * units;
  		    upy = Fy - floatcos((Fangle) * PI / 180) * units;
		}
		case RIGHT:
		{
  		    upx = Fx + floatsin((Fangle) * PI / 180) * units;
  		    upy = Fy + floatcos((Fangle) * PI / 180) * units;
		}
	    default:
	    	return 1;
	 }
	return 1;
}