Skip to content

Basic economy (issue 113)#114

Closed
Davidek523 wants to merge 17 commits intomainfrom
basic-economy-(issue-113)
Closed

Basic economy (issue 113)#114
Davidek523 wants to merge 17 commits intomainfrom
basic-economy-(issue-113)

Conversation

@Davidek523
Copy link
Collaborator

Code Pull Request Template

Summary

This PR Adds a basic economy into the game, every item has a price now. The player has a storage for his gold. When buying or selling the player's gold will be updated.

Related Issues

This PR issue(s) closes issue #113


✅ Checklist:

  • 🛠️ I have tested my code, and it works as expected (e.g., game runs without errors).
  • 📝 I have made sure that the code follows the project's formatting and style guidelines.

Optional:

  • 💬 Code is commented (if applicable)

🏷️ Labels:

  • type: ...
  • area: ...
  • game: ...

Added:
- a json file that stores the amount of gold
Added:
- new class for player graphical user interface
- changed the quantity in the player wallet
Added:
- basic logic to the player gui
Added:
- drew the gui onto the screen
Removed:
- unused code
Changed:
- position of the text to top right
- setup to use the json data
Changed:
- money changes dynamically
Added:
- when buying, a placeholder amount will be taken from the players money
- when selling, a placeholder amount will be given to the player
Testing something with the price
Added:
- helper methods for using the wallet json file
Fixed:
- gui not using the json file
- when changing wallet.json the json file would save differently
- selling gave a error
Added:
- buying works correctly
- selling works correctly
- every item has a price
Added:
- when opening shop the price is now visible of each item
Fixed:
- when buying a placeholder amount was deducted instead of the actual price
Tested:
- if player has 0 monye, would he go under 0 gold
Removed:
- code in player gui
Removed:
- 1 attribute 4 fun
Fixed:
- typehints with ruff
Copy link
Collaborator

@ultimateownsz ultimateownsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Davidek523 I'm not sure yet what you have done exactly. I see you made acceptance criteria and checked those, but there are no tasks surrounding what you did. It's a good start, though, and we need to come together to find common ground what the best solution for a basic economy is.

I have some ideas that we could implement to make it more clear what the economy can do for Pyceas, but it's still not very clear what the initial player can do if they have a currency. It would be wise to hold off this issue because the implementation is not very high in priority.

self.font = pygame.font.Font(None, 36)
self.screen = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))

def udpate(self, events):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You made a spelling mistake here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason to store the currency.py in the utils directory?

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.

2 participants

Comments