void ray_of_death_draw( const ray_of_death_t *rod ) { glColor4f(0.0, 0.1, 1.0, rod->intensity); glBegin(GL_LINE_STRIP); glVertex2f(rod->body.pos->x, rod->body.pos->y); glVertex2f(rod->body.pos->x + rod->direction.x, rod->body.pos->y + rod->direction.y); glEnd(); int i; for(i = 0; i < 100; i++) { particle[i].color.alpha = sqrt(sqrt(rod->intensity+1)); particle_draw(&particle[i]); } }
void draw(void) { SDL_FillRect(scaled, 0, SDL_MapRGB(scaled->format, 0, 0, 0)); if(title){ upscaleCopy(scaled, titlesurf, 2); } else { SDL_FillRect(s, 0, SDL_MapRGB(s->format, 0, 0, 0)); if (SDL_MUSTLOCK(s)) SDL_LockSurface(s); planet_draw(s); particle_draw(s); if (SDL_MUSTLOCK(s)) SDL_UnlockSurface(s); actor_draw(player, s); upscaleCopy(scaled, s, 2); } }