How to move an object from one card to another?
Posted: Tue Jul 15, 2025 7:55 am
Hello,
For a game I'm developing, I've implemented an inventory system. When you interact with an image, its visibility is set to 'false,' and the name of the image is added to a spare inventory 'slot' in an SQLite database.
When you select the item in a data grid and click the 'drop' button, the corresponding database entry is removed, and the image's visibility is set back to 'visible.' I know this might make me sound like a total beginner to the experienced coders here, but that's my approach.
1. The main issue with my current method is that when you move between cards (or 'rooms' in my game), the image doesn’t transfer with you. While the database entry in the inventory travels with you, you can't drop items in different cards because they are tied to a specific card.
2. Is there a better way to handle this before it's too late? I’m working on a demo game to learn and avoid fundamental mistakes that could cause problems later on.
3. Can I make the object move to the current card if the player chooses to drop it in a different room?
For a game I'm developing, I've implemented an inventory system. When you interact with an image, its visibility is set to 'false,' and the name of the image is added to a spare inventory 'slot' in an SQLite database.
When you select the item in a data grid and click the 'drop' button, the corresponding database entry is removed, and the image's visibility is set back to 'visible.' I know this might make me sound like a total beginner to the experienced coders here, but that's my approach.
1. The main issue with my current method is that when you move between cards (or 'rooms' in my game), the image doesn’t transfer with you. While the database entry in the inventory travels with you, you can't drop items in different cards because they are tied to a specific card.
2. Is there a better way to handle this before it's too late? I’m working on a demo game to learn and avoid fundamental mistakes that could cause problems later on.
3. Can I make the object move to the current card if the player chooses to drop it in a different room?