Hi This my first little game in Pokitto. Im a fresh in C++ So, Wishing your advise!!!!!
Dependencies: PokittoLib
Diff: playgame.h
- Revision:
- 2:7af6d9415495
- Parent:
- 1:8d5b6cdae9df
--- a/playgame.h Sun Mar 18 02:38:58 2018 +0000 +++ b/playgame.h Thu Mar 22 07:26:17 2018 +0000 @@ -3,7 +3,7 @@ @file Playgame.h @author WTW - @section v0.3 + @section v0.4 adding AreIntersecting function using collision detection */ @@ -15,8 +15,17 @@ #include "bullet.h" #include "aircraft.h" #include "palette.h" -#define BULLET_AMOUNT_MAX 300 -#define BULLET_TIME_SPACE 10 +#define BULLET_AMOUNT_MAX_EASY 20 +#define BULLET_TIME_SPACE_EASY 100 +#define BULLET_AMOUNT_MAX_NORMAL 50 +#define BULLET_TIME_SPACE_NORMAL 50 +#define BULLET_AMOUNT_MAX_HARD 100 +#define BULLET_TIME_SPACE_HARD 20 +#define BULLET_AMOUNT_MAX_VHARD 200 +#define BULLET_TIME_SPACE_VHARD 10 +#define BULLET_AMOUNT_MAX_DEAD 300 +#define BULLET_TIME_SPACE_DEAD 5 + #define AIRCRAFT_X_OFFSET 7 #define AIRCRAFT_Y_OFFSET 7 #define BULLET_X_OFFSET 1 @@ -25,6 +34,8 @@ std::vector<bullet> vbullet; aircraft air1; int bullettimespace = 0; +int bullet_amount_max = BULLET_AMOUNT_MAX_NORMAL; +int bullet_time_space = BULLET_TIME_SPACE_NORMAL; uint32_t oldTime,finalTime; bool AreIntersecting(const aircraft & air, const bullet & bul); void playgame(); @@ -50,8 +61,8 @@ air1.display(); ++bullettimespace; - if(bullettimespace == BULLET_TIME_SPACE){ //control bulltet object max amount - if(vbullet.size() <= BULLET_AMOUNT_MAX){ + if(bullettimespace == bullet_time_space){ //control bulltet object max amount + if(vbullet.size() <= bullet_amount_max){ bullet *bl = new bullet(air1.getx()+AIRCRAFT_X_OFFSET, air1.gety()+AIRCRAFT_Y_OFFSET); vbullet.push_back(*bl); }