Create Health, Timer, Start game, End game function#3
Merged
AmberPotion merged 3 commits intothoth-tech:mainfrom Oct 1, 2024
Merged
Create Health, Timer, Start game, End game function#3AmberPotion merged 3 commits intothoth-tech:mainfrom
AmberPotion merged 3 commits intothoth-tech:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BeeFall.2024-09-18.22-04-19.mp4
Description
Player Health System:
Implemented a health system with
get_HP()andset_HP()functions within the Player class.The player's health decreases when a collision with an obstacle is detected.
The game ends when the player's health reaches zero.
Timer Feature:
A timer was added to track game time using
create_timer()andupdate_timer().Time is displayed on the screen during the game.
The timer is reset when the game starts and pauses upon game over.
Game Start and End Functions:
A start screen is shown, and the game starts when the player presses the space bar (
start_game()function).A game over screen appears when the player’s health drops to zero.
The game can be restarted by pressing the space bar again after game over (
check_game_over()function).Rendering Updates:
Added scaling for the player bitmap and debug visualizations using
bitmap_cell_circle()to detect collisions.Obstacles are cleared when the game ends, and the player’s health is reset when the game restarts.
Type of change
Code
How Has This Been Tested?
Compiled and ran with
skm g++ program.cpp player.cpp obstacle.cpp bullet_factory.cpp -o game.exe
Checklist
My code follows the style guidelines of this project
I have performed a self-review of my own code
I have commented my code in hard-to-understand areas
I have made corresponding changes to the documentation
My changes generate no new warnings
I have requested a review from team members on the Pull Request