Posted April 25, 2025 by NiC0C0C0
// Changelog
// Version: 0.8.6
// Implemented new enemy spawning logic to start with 5 baseline enemies and progress to tougher enemies every 5 destroyed.
// Introduced periodic spawning of "Smaller, faster enemy" every 10 seconds to increase difficulty.
// Updated enemy spawning logic to phase out baseline enemies for tougher ones as the game progresses.
// Adjusted game state management to handle new enemy spawning rules and timers.
// Enhanced gameplay balance and difficulty progression for a more challenging experience.
// Version: 0.8.5
// Expanded enemy profiles with additional attributes, including five more profiles with increased attributes and one smaller, faster enemy profile.
// Updated enemy spawning logic to randomly select from the expanded set of enemy profiles.
// Enhanced visual differentiation of enemies by assigning unique colors to each profile.
// Adjusted collision detection to account for varying enemy sizes and speeds.
// Version: 0.8.4
// Integrated logic to randomly upgrade one of the stats (projectile speed, rate of fire, player movement speed, projectile damage) every 5 enemies destroyed.
// Adjusted enemy spawning logic to add one enemy every 5 destroyed.
// Added missing constant GAME_UPDATE_INTERVAL_MS for game update timing.
// Changed enemy spawn increment logic to be based on the number of enemies destroyed.
// Updated the game loop to dynamically adjust the enemy spawn count based on player performance.
// Version: 0.8.3
// Updated to use GdkMonitor API for fullscreen native resolution to avoid deprecated warnings.
// Modified the game to launch in fullscreen mode using the native resolution of screen 0.
// Fixed issue with enemies not appearing by ensuring spawn_enemies is called with the correct count.
// Version: 0.8.2
// Added an "Exit Game" button to the in-game pause menu for direct game exit.
// Fixed issues with undefined M_PI by defining it manually if not available.
// Resolved overloaded function matches for cos, sin, and sqrt by ensuring correct usage of std:: prefix and argument types.
// Ensured size_t is defined by including <cstddef> header.
// Improved code organization and clarity for better readability and maintainability.
// Enhanced game state management with clearer transitions and proper timer handling.
// Refined input handling for accurate game response to user inputs.
// Optimized drawing logic for efficient screen updates.
// Improved timer management to prevent memory leaks and ensure expected behavior.
// Enhanced random number generation for more varied gameplay.
// Fixed minor bugs and improved overall stability.
// Fixed segmentation fault when transitioning to the main menu by ensuring proper game state transition and resource management.
// Version: 0.8.1
// Improved code organization and clarity for better readability and maintainability.
// Enhanced game state management with clearer transitions and proper timer handling.
// Refined input handling for accurate game response to user inputs.
// Optimized drawing logic for efficient screen updates.
// Improved timer management to prevent memory leaks and ensure expected behavior.
// Enhanced random number generation for more varied gameplay.
// Fixed minor bugs and improved overall stability.
// Version: 0.8
// Implemented incremental enemy spawning over time to increase game difficulty.
// Added a timer to increment the number of enemies spawned every 10 seconds.
// Updated the spawn_enemy function to spawn multiple enemies based on the current spawn count.
// Reset enemy spawn count when the game restarts to ensure consistent difficulty progression.
// Maintained existing game mechanics and UI elements from previous versions.
// Version: 0.7
// Reduced font size for player stats and enemy count display.
// Implemented display for enemy count and player stats on the screen.
// Added a timer display at the top center of the screen to show elapsed playtime.
// Added a game timer that updates every second and resets when the game restarts.
// Integrated the timer display into the drawing routine to render the elapsed time.
// Lowered base values for projectile damage, projectile speed, rate of fire, and player movement speed for increased initial difficulty.
// Implemented random stat upgrade system with lower base values for initial difficulty.
// Added speed attribute to projectiles and player.
// Implemented logic to randomly upgrade one of the stats (projectile speed, rate of fire, player movement speed) every 5 enemies destroyed.
// Version: 0.6
// Implemented enemy spawning from the edges of the screen and chasing behavior towards the player.
// Added collision detection between enemies and the player, resulting in game over.
// Implemented collision detection between projectiles and enemies, removing both upon collision.
// Updated game loop to handle enemy behavior and collisions.
// Added functionality to respawn enemies upon being hit by projectiles.
// Fixed player movement issue by resetting keys array and reinitializing player position on game restart.
// Added autofire mechanic for player with a controlled fire rate, active only when the left mouse button is held down.
// Improved autofire to fire a projectile immediately when the left mouse button is pressed.
// Version: 0.5.1
// Fixed the projectile creation issue by creating a Projectile object before adding it to the vector.
// Added explicit casting of player coordinates to double to resolve narrowing conversion warnings.
// Added functionality to fire projectiles from the player towards the mouse cursor on left click.
// Implemented mouse button press event handling to detect left mouse clicks.
// Created projectiles that move in the direction of the pointer line.
// Updated projectile positions over time and removed them when they hit the side of the screen.
// Version: 0.5
// Added functionality to point the player towards the mouse cursor using mouse motion events.
// Implemented mouse motion event handling to capture the current mouse position.
// Calculated the angle between the player's position and the mouse cursor.
// Drew a line from the player's position towards the mouse cursor to visually indicate the direction.
// Version: 0.4.1
// Added functionality to start the game in fullscreen mode and integrated main menu.
// Integrated the main menu with "Play Game" and "Exit Game" buttons.
// Version: 0.4
// Added a main menu with "Play Game" and "Exit Game" buttons.
// Improved the layout and button sizes for better user experience.
// Version: 0.3
// Simplified to start the game immediately without a main menu.
// Retained pause functionality with "Continue Game" and "Exit Game" buttons.
// Unified window size and playing area dimensions.
// Version: 0.2
// Added player controller to move a circle using W, A, S, D keys.
// Adjusted boundary checks to stop the circle at the edge rather than the center.
// Set the window to full screen mode to prevent the circle from going out of sight.
// Implemented support for diagonal movement by tracking multiple key presses.
// Added a timer to ensure instantaneous movement without relying on key repeat.
// Version: 0.1
// Initial setup of a GTK window with a size of 1920x1080 for the game's play area.