-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItem.h
More file actions
50 lines (38 loc) · 1010 Bytes
/
Item.h
File metadata and controls
50 lines (38 loc) · 1010 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
43
44
45
46
47
48
49
50
/*******************************************************************************
CommanderTux
Penguin In Space
Released under the GNU Public License
2005 by Andr� Schnabel (thefrogs@web.de)
*******************************************************************************/
// Item.h
#ifndef ITEM_H
#define ITEM_H
#include "Sprite.h"
#include "Defines.h"
static int item_scores[NUM_ITEMS] =
{
5, // Fish
15, // Burger
10, // Hotdog
20, // C book
25, // C++ book
15, // SDL book
10, // Drink
50, // Nine Inch Nails CD
0, // Bullets
0, // Live
};
class CItem : public CSprite
{
public:
CItem( SDL_Texture *image, int id )
: CSprite( image ), m_id( id )
{ m_score = item_scores[id]; }
void SetScore( int score ) { m_score = score; }
int GetScore() { return m_score; }
int GetId() { return m_id; }
private:
int m_score;
int m_id;
};
#endif