All pastes #558071 Raw Edit

sdsd

public cpp v1 · immutable
·published 2007-06-11 06:52 UTC
rendered paste body
int X=0;		int Y=0;		SDL_GetMouseState(&X, &Y);		double angle = (asin(Y/sqrt(((double)X*X + Y*Y)))) ;		double YY = (Y-y)/angle;		double XX = (X-x)/angle;		int z = sqrt(((double)XX*XX + YY*YY));			//velx = x + z * cos(angle);			//vely = y + z * sin(angle);			particles[pnum].type 		= 	1;			particles[pnum].x 			= 	x + z * cos(angle);//x + rhand.x[2]*m/2;			particles[pnum].y			=	y - z * sin(angle);//y + rfoot.y[2]*m/2;			particles[pnum].velx 		= 	velx + ( dir == 0 ? -16.0f : 16.0f);			particles[pnum].vely 		= 	0.0f;			particles[pnum].timeleft	=	5000;			pnum++;			if(pnum >= maxparticles)				pnum = 0;//Ryan Sucks >.>