How do I make "pick up and drop" inventory?

Get help using Construct 2

Post » Sun Sep 20, 2015 9:44 pm

I have this inventory
Image

I can pick up items in the game that get attached to the cursor.
Image

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"

Image

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?
B
7
Posts: 28
Reputation: 333


Post » Mon Sep 21, 2015 3:38 pm

Hi @Excyis

Try this method.

Image

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
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Mon Sep 21, 2015 4:00 pm

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.
B
7
Posts: 28
Reputation: 333

Post » Sun Sep 27, 2015 3:52 pm

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.


Good luck!
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Sun Sep 27, 2015 5:57 pm

TonyW anything is possible in C2 if you plan it properly.
B
255
S
39
G
15
Posts: 1,975
Reputation: 40,989


Return to How do I....?

Who is online

Users browsing this forum: sean080 and 7 guests