ajtgarber

SDL_Rect draw bug (bullet.cpp)

Apr 8th, 2011
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include "Bullet.h"
  2.  
  3. Bullet::Bullet(int x, int y, int xvel, int yvel) : Entity((SDL_Rect) {x, y, 5, 5}) {
  4.     setXVel(xvel);
  5.     setYVel(yvel);
  6. }
  7.  
  8. void Bullet::render(SDL_Surface* surface) {
  9.     SDL_Rect bounds = getBounds();
  10.     SDL_FillRect(surface, &bounds, SDL_MapRGB(surface->format, 255, 0, 0));
  11. }
Advertisement
Add Comment
Please, Sign In to add comment