definitions.hpp 2.2 KB

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