All pastes #589502 Raw Edit

Someone

public text v1 · immutable
#589502 ·published 2007-06-26 00:55 UTC
rendered paste body
		if(keystate[SDLK_SPACE])
		{
		int X=0;
		int Y=0;
		SDL_GetMouseState(&X, &Y);
		double angle = (asin((Y-y)/sqrt(((double)(X-x)*(X-x) + (Y-y)*(Y-y))))); 
			//velx = x + z * cos(angle);
			//vely = y + z * sin(angle);
			particles[pnum].type 		= 	1;
			particles[pnum].x 			= 	x;
			particles[pnum].y			=	y;
			particles[pnum].velx 		= 	X < x ? -(8 * cos(angle)) : (8 * cos(angle));
			particles[pnum].vely 		= 	8 * sin(angle);
			particles[pnum].timeleft	=	5000;
			pnum++;
			if(pnum >= maxparticles)
				pnum = 0;
		}