definitions.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef _definitions_
  2. #define _definitions_
  3. //MAIN LIBRARIES INCLUDES
  4. #include <cstdlib>
  5. #include <ctime>
  6. #include <fstream>
  7. #include <sstream>
  8. #include <algorithm>
  9. #include <iostream>
  10. #include <iomanip>
  11. #include <list>
  12. #include <vector>
  13. #include <cmath>
  14. #include <unistd.h>
  15. //#include <pthread.h> //for sounds
  16. #include <sys/stat.h> //for making directories
  17. #include <ncurses.h> //for graphics
  18. #include <mutex>
  19. //GAME BOX DIMENSIONS
  20. #define R 30 //rows (Y)
  21. #define C 60 //columns (X)
  22. //GAME DEFINES
  23. #define AVERAGE_DROP 2
  24. #define POWERUP_RATIO 2
  25. #define ROCKET_RATIO 3
  26. #define MAX_WEAPONCLASS 5
  27. #define MAX_WEAPONCLASSRKT 5
  28. #define MAX_LENGTH 20
  29. #define CMD_NUM 9
  30. #ifdef R
  31. #define MAX_WIDTH R
  32. #endif
  33. #ifdef C
  34. #define MAX_HEIGHT C
  35. #endif
  36. #define GLOBAL_DIR "/home/150/invaders/"
  37. #define RECORD_DIR "/.invaders/"
  38. #define RECORD_FILE "records.dat"
  39. #define RECORD_FILE_BOSSRUSH "records_bossrush.dat"
  40. #define CHEAT_CODE "pinkie"
  41. #define BOSS_FILE1 "spoletini"
  42. #define BOSS_FILE2 "palombo"
  43. #define BOSS_FILE3 "maderna"
  44. #define BOSS_FILE4 "maero"
  45. #define BOSS_FILE5 "big_alienboss"
  46. #define PLAYER_SPRITE '='
  47. #define ENEMY_SPRITE '#'
  48. #define BULLET_SPRITE '|'
  49. #define BOMB_SPRITE 'o'
  50. #define POWERUP1_SPRITE '+'
  51. #define POWERUP2_SPRITE '-'
  52. #define POWERUP3_SPRITE 'X'
  53. #define WALL_SPRITE '@'
  54. #define ROCKET_SPRITE '^'
  55. //THREAD DEFINES
  56. //#define THREADS_NUM 5
  57. //COLORS
  58. #define red "\033[31m"
  59. #define crimson "\033[1;31m"
  60. #define magenta "\033[35m"
  61. #define violet "\033[1;35m"
  62. #define green "\033[32m"
  63. #define lightgreen "\033[1;32m"
  64. #define blue "\033[34m"
  65. #define lightblue "\033[1;34m"
  66. #define none "\033[0m"
  67. #define yellow "\033[33m"
  68. #define orange "\033[1;33m"
  69. #define cyan "\033[36m"
  70. #define azure "\033[1;36m"
  71. #define grey "\e[1;30m"
  72. #define backred "\033[41m"
  73. #define backcyan "\033[46m"
  74. #define backgreen "\033[1;42m"
  75. static int ENEMY_NUM=1;
  76. static int WALLS_NUM;
  77. extern std::mutex m_player;
  78. extern std::mutex m_enemies;
  79. extern std::mutex m_bombs;
  80. extern std::mutex m_bullets;
  81. extern std::mutex m_rockets;
  82. extern std::mutex m_pow;
  83. extern std::mutex m_boss;
  84. extern std::mutex m_walls;
  85. #endif