-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbullets.h
More file actions
42 lines (31 loc) · 916 Bytes
/
bullets.h
File metadata and controls
42 lines (31 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __BULLETS_H__
#define __BULLETS_H__
#include <list>
#include "chunk.h"
#include "sprite.h"
#include "collisionStrategy.h"
class Bullets : public Sprite{
public:
Bullets(const std::string&);
Bullets(const Bullets&);
~Bullets();
void draw() const;
void draw(const float scale);
void update(Uint32 ticks);
void shoot(const Vector2f& pos, const Vector2f& vel);
unsigned int bulletCount() const {return bulletList.size();}
unsigned int freeCount() const {return freeList.size();}
bool shooting() const {return bulletList.empty();}
bool collideWith(const Drawable* obj) const;
private:
std::string name;
CollisionStrategy* strategy;
//SDL_Surface *bulletSurface;
Frame* bulletFrame;
float frameInterval;
float timeSinceLastFrame;
mutable std::list<Chunk*> bulletList;
mutable std::list<Chunk*> freeList;
Bullets& operator=(const Bullets&);
};
#endif