Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This example program is created by thecplusplusuy for demonstration purposes. It's a simple mario like side-scroller game:
- //http://www.youtube.com/user/thecplusplusguy
- //Free source, modify if you want, LGPL licence (I guess), I would be happy, if you would not delete the link
- //so other people can see the tutorial
- //this file is bullet.h a class for a bullet
- #include <SDL/SDL.h> //for SDL
- #include <iostream> //if we want to write out something, probobly it can be deleted if you don't want
- #ifndef BULLET_H //avoid multiple indclusion
- #define BULLET_H
- class bullet{
- SDL_Rect box; //bounding box (for the blitting and for the collision detection)
- int xvel,yvel; //the velocity (speed)
- SDL_Surface* image; //the image of the bullet
- public:
- bullet(SDL_Surface* img,int x,int y,int xvel,int yvel); //constructor
- //obvious
- void move();
- void show(SDL_Surface* screen);
- SDL_Rect* getRect();
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement