SuperSpaceInvaderTurboApoca.../headers/utils.h
2022-01-07 09:05:21 +01:00

37 lines
817 B
C++

#ifndef GUARD_UTILS_H
#define GUARD_UTILS_H
#include<vector>
#include<mingl/mingl.h>
// hardcoded values
#define PLAYER_HEIGHT 100
#define PROJ_LENGTH_FACTOR 2
// TODO utiliser ca de partout
#define INV_GET_POS(i) confData.invadersSize*(i)+confData.invadersDistance*(i)
using namespace std;
using nsGraphics::RGBAcolor;
enum class WinValue{
NOBODY, // should never be used
PLAYERS,
INVADERS,
};
typedef nsGraphics::Vec2D Position;
typedef unsigned playerID;
#define PLAYER1 0
#define PLAYER2 1
// didn't want to use Position because of the semantic with x and y
bool areLinesColliding(unsigned start1, unsigned end1, unsigned start2, unsigned end2);
// change draw position for a specified size (keeps the same center)
void applyTransformation(Position& pos, unsigned sizeFrom, unsigned sizeTo);
#endif