All pastes #280105 Raw Edit

Stuff

public cpp v1 · immutable
·published 2006-12-15 17:28 UTC
rendered paste body
void Game::DrawBullets() {	static int initialize = 1;	static int first_action = 1;	static int lastAction;	int spacer = 300;	if (initialize == 1) {		lastAction = SDL_GetTicks();		initialize = 0;	}	if ((SDL_GetTicks() >= (lastAction + spacer)) || first_action == 1) {		for (double i=-2.0, j = 0.2; i<2.0; i+=0.1) {			j -= (i/30);			projectiles.push_back(new Projectile("bullet_small", (bossPos_x + (sprBoss->GetSurface()->w / 2)), (bossPos_y + ((sprBoss->GetSurface()->h) - 20)), i, j));		}		lastAction = SDL_GetTicks();		if (first_action == 1) {			first_action = 0;		}	}	for (std::vector<Projectile*>::iterator i = projectiles.begin(); i != projectiles.end(); i++) {		(*i)->returnSpr()->MoveTo((*i)->posX(), (*i)->posY());		(*i)->returnSpr()->Draw();		(*i)->move();		if ((*i)->posX() < -20 || (*i)->posY() < -20 || (*i)->posX() > (WIN_W + 20) || (*i)->posY() > (WIN_H + 20)) {			//delete *i;		}	}}