State of Breakout
So my current project is working on a Breakout game for a university assignment.
Been going pretty well. Had most problem with getting the collisions looking "good". Had lots of nested if statements at first. Solved that somewhat when I started using the intersected part of the two collided objects, and then I compared if the width was larger than the height on that intersection. If it is more wide, it got hit from either top or bottom.
Now I'm currently working on the high score, latest runs, and getting username/initials. No big issue as of now. But I implemented a new enum, GameState, and a class, GameStateManager, to handle if it's paused, if i need user input for name, highscore etc. Not happy with my current implementation of having that state public in the Game class but with my current implementation I was forced to either have duplicated functions in two classes, where one just called the other. And I didn't wanna spend to much time on this for this project. But I want to for future project find a better solution where I hopefully spend a little more time planning the design first. And also learn more of how to structure the logic. So I'm seeing this as a learning opportunity.
So I think getting high scores and such won't take too much time. It's also going to write to files. Think I want to look into binary files and see how they work.
After that I'm done with what's "needed" for this project.
Then I want to implement a thing where if that bat is moving, the ball reacts to the bat hit; if it's moving in the same direction as the ball, the angle gets more narrow, and the opposite if they are approaching each other.