]> git.mxchange.org Git - quix0rs-blobwars.git/blob - src/CEntity.h
Add doc/samples which more accurately tracks samples origin
[quix0rs-blobwars.git] / src / CEntity.h
1 /*
2 Copyright (C) 2004-2010 Parallel Realities
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 class Entity : public GameObject {
22
23         public:
24
25                 char name[50];
26
27                 float x, y, dx, dy;
28                 int tx, ty, width, height;
29
30                 signed char oxygen, fuel;
31
32                 unsigned char immune;
33                 unsigned char environment, damage;
34                 unsigned char face;
35
36                 signed int thinktime, baseThink, health, reload;
37
38                 unsigned int id, value;
39                 long flags;
40                 unsigned char currentFrame, currentTime;
41
42                 int deathSound;
43                 
44                 Sprite *sprite[3];
45
46                 bool falling;
47
48                 Weapon *currentWeapon;
49                 
50                 int dead;
51
52                 Entity *owner;
53
54         Entity();
55         void setName(const char *name);
56         void setSprites(Sprite *sprite1, Sprite *sprite2, Sprite *sprite3);
57         void animate();
58         SDL_Surface *getFaceImage();
59         void place(int x, int y);
60         void setVelocity(float dx, float dy);
61         void move();
62         void setRandomVelocity();
63         void applyGravity();
64         void checkEnvironment();
65         void think();
66         
67 };