utilies for the game
More...
#include <vector>
#include "mingl/mingl.h"
Go to the source code of this file.
utilies for the game
- Author
- RUBINI Thomas
- Date
- January 2022
- Version
- 1.0
Definition in file utils.h.
◆ DEBUG_INSTR
◆ DEBUG_MSG
◆ INV_GET_POS
#define INV_GET_POS |
( |
|
i | ) |
confData.invadersSize*(i)+confData.invadersDistance*(i) |
◆ PLAYER1
◆ PLAYER2
◆ PLAYER_HEIGHT
#define PLAYER_HEIGHT 100 |
◆ PROJ_LENGTH_FACTOR
#define PROJ_LENGTH_FACTOR 2 |
◆ playerID
◆ Position
◆ WinValue
list of win values
Enumerator |
---|
NOBODY | |
PLAYERS | |
INVADERS | |
GOD | |
Definition at line 45 of file utils.h.
◆ applyTransformation()
void applyTransformation |
( |
Position & |
pos, |
|
|
unsigned |
sizeFrom, |
|
|
unsigned |
sizeTo |
|
) |
| |
change the size of a Position object
- Parameters
-
[in,out] | pos | : Position object |
[in] | sizeFrom | current size of the objet |
[in] | sizeTo | : new size of the object |
Definition at line 8 of file utils.cpp.
◆ areLinesColliding()
bool areLinesColliding |
( |
unsigned |
start1, |
|
|
unsigned |
end1, |
|
|
unsigned |
start2, |
|
|
unsigned |
end2 |
|
) |
| |
tells if 2 lines are colliding in a 1 dimentionnal space
- Parameters
-
[in] | start1 | : position of the first point of the first line |
[in] | end1 | posision of the last point of the first line |
[in] | start2 | : position of the first point of the seconde line |
[in] | end2 | posision of the last point of the second line |
- Returns
- true if they are olliding, false elsewise
Definition at line 3 of file utils.cpp.