-
Notifications
You must be signed in to change notification settings - Fork 4
Obstacle areas (issue 120) #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added: - new state for obstacles - state methods within this class
Added: - obstacles to the map - in setup drew the obstacles onto the map - in obstacle state added logic for collision
Fixed: - in game running: Typo from the imported class - obstacle state: logical issues with collision
Changed: - Removed the object state from states and refactored it to not use state anymore - Changed file name and the file place
Called: - object handler in game running
Fixed: - issue where message of dealing damage was not showing up Changed: - commentend display flip method in object handler to save frames
Changed: - the black block for the message transparent
Changed: - the color of the message
β¦-areas-(issue-120)
Fixed all the typehints
ultimateownsz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, since there is no objective for the player yet, I think what could work with the collisions is that is the player health < 0, that it will reset the player's position to the starting position.

Also, I think it could be helpful if you make it that you see the player getting a white border or flashing sprite that it shows to the player that you hit an object, because now it is static, and the drawing order could be different, so the player's (rectangle for now) behind the obstacle, instead of over the obstacle.

Fixed: - Health going infinitly low
Added: - a flashing effect when the player gets hurt by the obstacles
Changed: - the location of the dt from the handler to the game loop
Fixed: - Flash not working properly Removed: - unnecessary delta time
Finished: - when the player comes in contact with a obstacle the rect will flash
Added: - when the player reaches 0 health, he will respawn at the start position with the maximum amount of health
Fixed: - typehint issues
|
Addressed the issues that you mentioned! Could you take a look? |
|
It's looking good, could you also add the collision with islands? And make the flashing player hit only when it's bein hit and not constantly? |
Fixed: - constant flashing when the player stays on the obstacle.
Changed: - the file name to object_manager - class name to ObjectManager - as requested
|
Fixed the issues you we're talking about and also changed the name of the file and the class as requested! Everything works, no bugs! |
ultimateownsz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, it all works. Before I forget, I would only want you to add unit tests since your obstacle_manager is a new feature for the project. Do this and your code can be merged!
Pull Request Template
Type of Pull Request
Only check one box per pull request.
Summary
This PR adds obstacles objects to the game. Now when the player comes in contact with such a object, the player will receive damage and on the screen it will be shown how much!
Related Issues
This PR closes issue(s) #120
β Checklist:
π·οΈ Labels:
type: ...,area: ...,game-..., ...