Skip to content

Conversation

@gregormaclaine
Copy link
Member

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.

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
@gregormaclaine gregormaclaine self-assigned this Feb 5, 2022
@gregormaclaine gregormaclaine requested review from AdamHeal, JaneM443 and egorvert and removed request for JaneM443 and egorvert February 5, 2022 02:12
Copy link
Collaborator

@egorvert egorvert left a 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.

@gregormaclaine
Copy link
Member Author

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.

@gregormaclaine
Copy link
Member Author

All bugs and changes requested by Egor have been implemented.
Branch is now ready for merge

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants