CBomber.cpp File Reference

The bombers. More...

#include "STDAFX.H"
#include "CBomber.h"
#include "CArena.h"
#include "CBomb.h"
#include "CDisplay.h"
#include "CItem.h"
#include "CSound.h"
#include "CArenaSnapshot.h"

Include dependency graph for CBomber.cpp:


Defines

#define SPEED_SLOW   76
 Speed with SLOW sickness.
#define SPEED_FAST   450
 Speed with FAST sickness.
#define SPEED_NORMAL   120
 Normal speed.
#define SPEED_INC   14
 Speed increase each time a roller item is picked up.
#define ANIMSICK_TIME1   0.090f
 Sick flashing animation times (in seconds).
#define ANIMSICK_TIME2   ANIMSICK_TIME1 * 2
#define ANIMWALK_TIME1   0.150f
 Walk animation times (in seconds).
#define ANIMWALK_TIME2   ANIMWALK_TIME1 * 2
#define ANIMWALK_TIME3   ANIMWALK_TIME1 * 3
#define ANIMWALK_TIME4   ANIMWALK_TIME1 * 4
#define ANIMDYING_TIME1   0.070f
 Dying animation times (in seconds).
#define ANIMDYING_TIME2   ANIMDYING_TIME1 * 2
#define ANIMDYING_TIME3   ANIMDYING_TIME1 * 3
#define ANIMDYING_TIME4   ANIMDYING_TIME1 * 4
#define ANIMDYING_TIME5   ANIMDYING_TIME1 * 5
#define ANIMDYING_TIME6   ANIMDYING_TIME1 * 6
#define ANIMDYING_TIME7   ANIMDYING_TIME1 * 7
#define ANIMBOMBLIFTING_TIME1   0.060f
 Bomb lifting animation times (in seconds).
#define ANIMBOMBLIFTING_TIME2   ANIMBOMBLIFTING_TIME1 * 2
#define ANIMBOMBLIFTING_TIME3   ANIMBOMBLIFTING_TIME1 * 3
#define ANIMBOMBTHROWING_TIME1   0.040f
 Bomb throwing animation times (in seconds).
#define ANIMBOMBTHROWING_TIME2   0.080f
#define ANIMBOMBTHROWING_TIME3   0.120f
#define ANIMBOMBTHROWING_TIME4   0.200f
#define ANIMBOMBTHROWING_TIME5   0.280f
#define ANIMBOMBPUNCHING_TIME1   0.080f
 Bomb punching animation times (in seconds).
#define ANIMBOMBPUNCHING_TIME2   0.220f
#define ANIMBOMBPUNCHING_TIME3   0.320f
#define BOMBERSPRITE_DOWN0   0
 Animation sprites when walking (holding bomb and not holding bomb).
#define BOMBERSPRITE_DOWN1   1
#define BOMBERSPRITE_DOWN2   2
#define BOMBERSPRITE_RIGHT0   3
#define BOMBERSPRITE_RIGHT1   4
#define BOMBERSPRITE_RIGHT2   5
#define BOMBERSPRITE_LEFT0   6
#define BOMBERSPRITE_LEFT1   7
#define BOMBERSPRITE_LEFT2   8
#define BOMBERSPRITE_UP0   9
#define BOMBERSPRITE_UP1   10
#define BOMBERSPRITE_UP2   11
#define BOMBERSPRITE_DYING0   0
 Animation sprites when dying.
#define BOMBERSPRITE_DYING1   1
#define BOMBERSPRITE_DYING2   2
#define BOMBERSPRITE_DYING3   3
#define BOMBERSPRITE_DYING4   4
#define BOMBERSPRITE_DYING5   5
#define BOMBERSPRITE_DYING6   6
#define BOMBERSPRITE_LIFTING_DOWN_0   0
 Animation sprites when lifting a bomb.
#define BOMBERSPRITE_LIFTING_DOWN_1   1
#define BOMBERSPRITE_LIFTING_DOWN_2   2
#define BOMBERSPRITE_LIFTING_RIGHT_0   3
#define BOMBERSPRITE_LIFTING_RIGHT_1   4
#define BOMBERSPRITE_LIFTING_RIGHT_2   5
#define BOMBERSPRITE_LIFTING_LEFT_0   6
#define BOMBERSPRITE_LIFTING_LEFT_1   7
#define BOMBERSPRITE_LIFTING_LEFT_2   8
#define BOMBERSPRITE_LIFTING_UP_0   9
#define BOMBERSPRITE_LIFTING_UP_1   10
#define BOMBERSPRITE_LIFTING_UP_2   11
#define BOMBERSPRITE_THROWING_DOWN_0   0
 Animation sprites when throwing a bomb.
#define BOMBERSPRITE_THROWING_DOWN_1   1
#define BOMBERSPRITE_THROWING_DOWN_2   2
#define BOMBERSPRITE_THROWING_DOWN_3   3
#define BOMBERSPRITE_THROWING_DOWN_4   4
#define BOMBERSPRITE_THROWING_RIGHT_0   5
#define BOMBERSPRITE_THROWING_RIGHT_1   6
#define BOMBERSPRITE_THROWING_RIGHT_2   7
#define BOMBERSPRITE_THROWING_RIGHT_3   8
#define BOMBERSPRITE_THROWING_RIGHT_4   9
#define BOMBERSPRITE_THROWING_LEFT_0   10
#define BOMBERSPRITE_THROWING_LEFT_1   11
#define BOMBERSPRITE_THROWING_LEFT_2   12
#define BOMBERSPRITE_THROWING_LEFT_3   13
#define BOMBERSPRITE_THROWING_LEFT_4   14
#define BOMBERSPRITE_THROWING_UP_0   15
#define BOMBERSPRITE_THROWING_UP_1   16
#define BOMBERSPRITE_THROWING_UP_2   17
#define BOMBERSPRITE_THROWING_UP_3   18
#define BOMBERSPRITE_THROWING_UP_4   19
#define BOMBERSPRITE_PUNCHING_DOWN_0   0
 Animation sprites when punching a bomb.
#define BOMBERSPRITE_PUNCHING_DOWN_1   1
#define BOMBERSPRITE_PUNCHING_RIGHT_0   2
#define BOMBERSPRITE_PUNCHING_RIGHT_1   3
#define BOMBERSPRITE_PUNCHING_LEFT_0   4
#define BOMBERSPRITE_PUNCHING_LEFT_1   5
#define BOMBERSPRITE_PUNCHING_UP_0   6
#define BOMBERSPRITE_PUNCHING_UP_1   7
#define FLAMESIZE_SMALLFLAME   1
 Flamesize when the bomber has the SMALLFLAME sickness.
#define BOMBTIMELEFT_NORMAL   2.0f
 Time left before a bomb the bomber dropped explodes.
#define BOMBTIMELEFT_SICKLONGBOMB   4.0f
#define BOMBTIMELEFT_SICKSHORTBOMB   1.0f
#define RETURNITEMS_WAIT   0.8f
 Wait before rint the items the bomber picked up if bomber is dead (in seconds).
#define BOMBER_OFFSETX   (-6)
#define BOMBER_OFFSETY   (-12)
#define CONTAMINATION_NEAR   9
 Manhattan distance Used for contamination to determine if a bomber can be considered to be NEAR another bomber. A bomber is near another if abs(x2-x1) + abs(y2-y1) <= CONTAMINATION_NEAR. This is the manhattan distance in pixels (http://en.wikipedia.org/wiki/Manhattan_distance).
#define BOMBER_SPRITELAYER   50
 Bomber sprite layer.
#define SICK_SPRITE_ROW_FULL   MAX_PLAYERS
 The row with the full black bomber sprites (this is the number of maximum players).
#define SICK_SPRITE_ROW_SHADOW   (MAX_PLAYERS + 1)
 The row with the black shadow bomber sprites (one row below SICK_SPRITE_ROW_FULL).
#define REMOTE_FUSE_ONLY_FIRST_BOMB   true
 Fuse only the first bomb found? If set to true, only the first bomb will be fused by the remote control of a bomber. If set to false, all bombs are immediately fused. First means: the first bomb found in the bomb array, not the first in time.

Detailed Description

The bombers.

Jouabilite : Pour dans longtemps, pour rendre les deplacements encore mieux. Si a gauche le bomber est bloque, on regarde la direction qu'il avait avant de vouloir tourner, par exemple haut, et dans ce cas qqsoit sa position (mais on verifie qd meme s'il peut aller par la) il ira en haut pour eviter le mur. Comment peut il etre vraiment bloque ? il suffit qu'il soit une direction comme droite et qu'il veuille aller a droite...

Bugs :

Optims :

bug contamination : lorsqu'il y a plus de deux joueurs sur une case qui se suivent, avec un joueur malade, y a plein de contamination alors qu'il faudrait pas.


Define Documentation

#define ANIMBOMBLIFTING_TIME1   0.060f

Bomb lifting animation times (in seconds).

#define ANIMBOMBLIFTING_TIME2   ANIMBOMBLIFTING_TIME1 * 2

#define ANIMBOMBLIFTING_TIME3   ANIMBOMBLIFTING_TIME1 * 3

#define ANIMBOMBPUNCHING_TIME1   0.080f

Bomb punching animation times (in seconds).

#define ANIMBOMBPUNCHING_TIME2   0.220f

#define ANIMBOMBPUNCHING_TIME3   0.320f

#define ANIMBOMBTHROWING_TIME1   0.040f

Bomb throwing animation times (in seconds).

#define ANIMBOMBTHROWING_TIME2   0.080f

#define ANIMBOMBTHROWING_TIME3   0.120f

#define ANIMBOMBTHROWING_TIME4   0.200f

#define ANIMBOMBTHROWING_TIME5   0.280f

#define ANIMDYING_TIME1   0.070f

Dying animation times (in seconds).

#define ANIMDYING_TIME2   ANIMDYING_TIME1 * 2

#define ANIMDYING_TIME3   ANIMDYING_TIME1 * 3

#define ANIMDYING_TIME4   ANIMDYING_TIME1 * 4

#define ANIMDYING_TIME5   ANIMDYING_TIME1 * 5

#define ANIMDYING_TIME6   ANIMDYING_TIME1 * 6

#define ANIMDYING_TIME7   ANIMDYING_TIME1 * 7

#define ANIMSICK_TIME1   0.090f

Sick flashing animation times (in seconds).

#define ANIMSICK_TIME2   ANIMSICK_TIME1 * 2

#define ANIMWALK_TIME1   0.150f

Walk animation times (in seconds).

#define ANIMWALK_TIME2   ANIMWALK_TIME1 * 2

#define ANIMWALK_TIME3   ANIMWALK_TIME1 * 3

#define ANIMWALK_TIME4   ANIMWALK_TIME1 * 4

#define BOMBER_OFFSETX   (-6)

#define BOMBER_OFFSETY   (-12)

#define BOMBER_SPRITELAYER   50

Bomber sprite layer.

#define BOMBERSPRITE_DOWN0   0

Animation sprites when walking (holding bomb and not holding bomb).

#define BOMBERSPRITE_DOWN1   1

#define BOMBERSPRITE_DOWN2   2

#define BOMBERSPRITE_DYING0   0

Animation sprites when dying.

#define BOMBERSPRITE_DYING1   1

#define BOMBERSPRITE_DYING2   2

#define BOMBERSPRITE_DYING3   3

#define BOMBERSPRITE_DYING4   4

#define BOMBERSPRITE_DYING5   5

#define BOMBERSPRITE_DYING6   6

#define BOMBERSPRITE_LEFT0   6

#define BOMBERSPRITE_LEFT1   7

#define BOMBERSPRITE_LEFT2   8

#define BOMBERSPRITE_LIFTING_DOWN_0   0

Animation sprites when lifting a bomb.

#define BOMBERSPRITE_LIFTING_DOWN_1   1

#define BOMBERSPRITE_LIFTING_DOWN_2   2

#define BOMBERSPRITE_LIFTING_LEFT_0   6

#define BOMBERSPRITE_LIFTING_LEFT_1   7

#define BOMBERSPRITE_LIFTING_LEFT_2   8

#define BOMBERSPRITE_LIFTING_RIGHT_0   3

#define BOMBERSPRITE_LIFTING_RIGHT_1   4

#define BOMBERSPRITE_LIFTING_RIGHT_2   5

#define BOMBERSPRITE_LIFTING_UP_0   9

#define BOMBERSPRITE_LIFTING_UP_1   10

#define BOMBERSPRITE_LIFTING_UP_2   11

#define BOMBERSPRITE_PUNCHING_DOWN_0   0

Animation sprites when punching a bomb.

#define BOMBERSPRITE_PUNCHING_DOWN_1   1

#define BOMBERSPRITE_PUNCHING_LEFT_0   4

#define BOMBERSPRITE_PUNCHING_LEFT_1   5

#define BOMBERSPRITE_PUNCHING_RIGHT_0   2

#define BOMBERSPRITE_PUNCHING_RIGHT_1   3

#define BOMBERSPRITE_PUNCHING_UP_0   6

#define BOMBERSPRITE_PUNCHING_UP_1   7

#define BOMBERSPRITE_RIGHT0   3

#define BOMBERSPRITE_RIGHT1   4

#define BOMBERSPRITE_RIGHT2   5

#define BOMBERSPRITE_THROWING_DOWN_0   0

Animation sprites when throwing a bomb.

#define BOMBERSPRITE_THROWING_DOWN_1   1

#define BOMBERSPRITE_THROWING_DOWN_2   2

#define BOMBERSPRITE_THROWING_DOWN_3   3

#define BOMBERSPRITE_THROWING_DOWN_4   4

#define BOMBERSPRITE_THROWING_LEFT_0   10

#define BOMBERSPRITE_THROWING_LEFT_1   11

#define BOMBERSPRITE_THROWING_LEFT_2   12

#define BOMBERSPRITE_THROWING_LEFT_3   13

#define BOMBERSPRITE_THROWING_LEFT_4   14

#define BOMBERSPRITE_THROWING_RIGHT_0   5

#define BOMBERSPRITE_THROWING_RIGHT_1   6

#define BOMBERSPRITE_THROWING_RIGHT_2   7

#define BOMBERSPRITE_THROWING_RIGHT_3   8

#define BOMBERSPRITE_THROWING_RIGHT_4   9

#define BOMBERSPRITE_THROWING_UP_0   15

#define BOMBERSPRITE_THROWING_UP_1   16

#define BOMBERSPRITE_THROWING_UP_2   17

#define BOMBERSPRITE_THROWING_UP_3   18

#define BOMBERSPRITE_THROWING_UP_4   19

#define BOMBERSPRITE_UP0   9

#define BOMBERSPRITE_UP1   10

#define BOMBERSPRITE_UP2   11

#define BOMBTIMELEFT_NORMAL   2.0f

Time left before a bomb the bomber dropped explodes.

#define BOMBTIMELEFT_SICKLONGBOMB   4.0f

#define BOMBTIMELEFT_SICKSHORTBOMB   1.0f

#define CONTAMINATION_NEAR   9

Manhattan distance Used for contamination to determine if a bomber can be considered to be NEAR another bomber. A bomber is near another if abs(x2-x1) + abs(y2-y1) <= CONTAMINATION_NEAR. This is the manhattan distance in pixels (http://en.wikipedia.org/wiki/Manhattan_distance).

#define FLAMESIZE_SMALLFLAME   1

Flamesize when the bomber has the SMALLFLAME sickness.

#define REMOTE_FUSE_ONLY_FIRST_BOMB   true

Fuse only the first bomb found? If set to true, only the first bomb will be fused by the remote control of a bomber. If set to false, all bombs are immediately fused. First means: the first bomb found in the bomb array, not the first in time.

#define RETURNITEMS_WAIT   0.8f

Wait before rint the items the bomber picked up if bomber is dead (in seconds).

#define SICK_SPRITE_ROW_FULL   MAX_PLAYERS

The row with the full black bomber sprites (this is the number of maximum players).

#define SICK_SPRITE_ROW_SHADOW   (MAX_PLAYERS + 1)

The row with the black shadow bomber sprites (one row below SICK_SPRITE_ROW_FULL).

#define SPEED_FAST   450

Speed with FAST sickness.

#define SPEED_INC   14

Speed increase each time a roller item is picked up.

#define SPEED_NORMAL   120

Normal speed.

#define SPEED_SLOW   76

Speed with SLOW sickness.


Generated on Sat Oct 18 12:26:38 2008 for Bombermaaan by  doxygen 1.5.5
Visit the Bombermaaan project page
SourceForge.net Logo