I have this inventory
I can pick up items in the game that get attached to the cursor.
When I drop the item on any of the slots, it disappears. I guess it doesn't get attached to that specific slot.
This is the "code"
How would I go about making such inventory which lets me pick up any item and drop it on the inventory. Without needing to repeat it for every single item in the game?
Develop games in your browser. Powerful, performant & highly capable.
find your answer here
Try this method.
Set a group of sprites on top of your inventory box with different frames set as the items you will gather.
Then use the drag and drop feature ...
* "on item dropped" item = "sword" set inventory sprite to the corresponding image.
*use a system function to check if the frame is greater then "0" to signal if the sprite box has already has been set to an item... if so, it moves to the next one and so on...
Im guessing you are pining the items because the board is moving??
put all your menu items on a layer of there own and set the layer parallax to "0,0" this will prevent the items from scrolling around on the screen.
hope this helps
Oh I appreciate the help!
LordShiva that thing is asking me to login for some reason D:
TonyW I appreciate the help, but I think it's my fault for forgetting to mention some things about my game.
The items in my game level up. So I'd rather not attach 200 variables to one sprite with all the item frames.
Or rather, I'm trying to find a way to pick up items with individual stats. Since you'll be able to level different things on them. So using the sprite-based system might be a bit too much?
Unless I'm unaware of a way to save specific item stats in different places.
EDIT: Also the inventory gets moved off-screen to hide it so it wouldn't take up screen space.
If you have a game that will level up In 200 difrent ways its prob going to be to much for the c2 engine anyway... I don't think it was built to handle that kind of game, But I could be wrong.
TonyW anything is possible in C2 if you plan it properly.