Conversation
Testing: - inventory gui
Removed: - two draw functions from the render method
Removed a import
Added: - a object layer for buildings - for example: shop
Added: - a custom property to the object
Added: - shop file
Added: - world layers to shop - shop to game running
Added: - drew the rect responsible for the shop
Added: - collision for the shop
Added: - a message when interacting with the shop
Added: - if pressing E message is shown
Added: - appearing black window when interacting with the shop
Fixed: - window dissapearing after letting go of the E key
Removed: - print statements for debugging
Added: - base state and the methods to the shop class
Added: - function for the buttons
Added: - a method for handling mouse clicks
Finished: - methods for the shop
Changed: - spltied class in two because it was not working as expected
Fixed: - some issues with the code and crashing - shop window not showing when clicking E
Fixed: - buttons not showing up
Changed: - the amount visible items
Issues: - fixed by ruff
Fixed: - to show shop you have to press E twice
Fixed: - if outside the shop and use E the shop would still open
Removed: - old unused code
Changed: - buttons from use and discard to buy and sell Added: - new messages to the json file for the shop
Added (to inventory.py): - buy method - sell method
Implemented: - buy and sell into shop.py
Added: - icons dict - extract_icons method
ultimateownsz
left a comment
There was a problem hiding this comment.
I really like how you've handled the interaction between the shop and inventory for the buy/sell functionality. It looks well-structured and intuitive to use.
While testing, I noticed that the inventory's visual feedback isn't very clear when interacting with the shop. For example, when buying or selling items, it's not immediately obvious which items are already owned or in what quantities. I understand this might be outside the scope of your current work on the buy/sell functionality, but I wanted to highlight it as something we could consider enhancing in the future to improve it.
src/states/game_running.py
Outdated
| self.shop = src.shop.ShowShop( | ||
| (x * TILE_SIZE, y * TILE_SIZE), surface, self.all_sprites, WORLD_LAYERS["main"] | ||
| ) | ||
| print(x, y) |
There was a problem hiding this comment.
You have to comment out this debug.
Removed: - the debug print statement
ultimateownsz
left a comment
There was a problem hiding this comment.
I approve these changes, we don't have to forget that in order to enter the shop state, you have to press the 'E' button which can be changed later on via an actual button or collide action like you already made.
Code Pull Request Template
Summary
This PR adds a basic functioning shop where the player can buy and sell items.
Related Issues
This PR Closes Issue #42 issue(s)
✅ Checklist:
Optional:
🏷️ Labels:
type: ...area: ...game: ...