-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented Finite State Machine #3
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
This commit technically does not work because for some reason at the start of the program the framerate acts a bit weird. It causes everything effected by gravity (player and enemies) to fall directly through the platforms and therefore go beneath the screen. This then immediately fixes itself as the framerate stabalises. I am not going to try to fix this because when there is a menu beforehand, it will allow time before the players and enemies are placed, meaning that issue should never occur.
# Conflicts: # src/main.cpp
# Conflicts: # src/main.cpp
This is a temporary commit, as currently the user stays in the menu stage and can't progress to the game due to the buttons not being fully functional.
# Conflicts: # src/Enemy.cpp # src/Enemy.hpp # src/Menu.cpp # src/Menu.hpp # src/Player.cpp # src/Player.hpp # src/main.cpp
egorvert
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.
Code is good and functional on Mac. It would be appreciated if you could add comments to your code to explain what it does so the rest of the team doesn't have to spend their precious time on figuring out what the hell you're doing.
Some bugs I noticed:
- Hitboxes are always shown and control / command B does not turn them off
- Resizing a window causes the character to fly off the screen
Tl;Dr
★★★★☆
Good feature rich commit but with little annotation and a few bugs. Also needs testing on Windows.
|
Woops closed it by accident. Also I see the bug with resizing the window, but the hitbox outlines work perfectly find for me? They don't show up to begin with and toggle visibility with Ctrl-B. |
…ough ground on gamestart
73b8f8c to
3ca3c02
Compare
|
All bugs and changes requested by Egor have been implemented. |
std::vector is dynamic so it can be freely added to, which will be important later on. It's also much easier to iterate through. I needed the vectors to be of the class pointers as sometimes (by that I mean all the time) the textures of the sprites would unload since the vector would keep trying to move the memory around which would break the reference between the texture and the sprite causing it to show a tan rectangle instead of the actual picture.
This feature branch creates a FSM framework for the program that will make it much easier to have different views that can be switched between such as the menu and the game. This also involved clearing up the code for the menu and modularising some of the features in it like the button.
The most recent commits in main have been merged into it, meaning it includes the new additions of player health and the background.
This version is also fully functional on macOS amd64, so it needs testing on windows before mergining into the main branch.