ultimateownsz / PySeas

Pyseas is an opensource project that aims to create a 2D, top down, turn based board game in Pygame. Where players become pirates and control their own ship. Using a card-based dice system, players explore a dynamic map, complete quests, and battle rival pirates.
GNU Affero General Public License v3.0
4 stars 3 forks source link

Main menu and button class #27

Closed Davidek523 closed 1 week ago

Davidek523 commented 2 months ago

I am working on the main menu for Pyseas. I've made a basic menu with a couple of options for settings. For now it does its job but doesn't use any assets yet. Now I plan to use the code from the main and add it to the menu to check if it is going to work as I intended it to work.

Davidek523 commented 2 months ago

I wanted also to say that thats my first pull request so I was testing a bit and I see know that I forgot to comment some stuff in the code. Thats why there are some errors there.

ultimateownsz commented 2 months ago

No problem you can add more to your pull request and commit that to your PR

Davidek523 commented 2 months ago

No problem you can add more to your pull request and commit that to your PR

Yes, I have already changed it and it should work as intended

PurpleProg commented 2 months ago

Hey, the button class looks clean but they are a few things wrong that you could fix :

Davidek523 commented 2 months ago

Hey, the button class looks clean but they are a few things wrong that you could fix :

  • there is no typehints (this is not absolutely necessary but it's better to have some)
  • there is a nested while loop at the end of the file
  • multiple event loop (or just while loop) is usually not the best, maybe look into a state machine. that can be a lot of work but it's way cleaner and more readable.
  • the use of SysFont is inconsistent across machines, you should load a font file (.ttf) instead
  • and the main issue i see is that this is not integrated in the rest of the game, but a standalone menu.

Yes I'll keep that in mind. As for the two last points as I said this was my first PR so I was really just testing and didin't want to mess with the main file yet. And sysfont is indeed a problem I have to fix. It was also just temporary you know. Thanks for the feedback!