This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-11-11 15:22:24

Jessydog
New Scratcher
Registered: 2012-09-09
Posts: 2

Inventory

I really need help with a game I'm making where I want someone to be able to drag a sprite into a bag, then later on be able to view items in the bag. The items in the Bag do not need to be retrievable.

Offline

 

#2 2012-11-11 15:26:01

stevetheipad
Scratcher
Registered: 2011-08-06
Posts: 1000+

Re: Inventory

To make the sprite movable, click the lock on the sprite's page. Then make a variable. Then make a script that adds the item's name to a list once it <touches [sprite#]>.


http://i.imgur.com/0x8ia.jpg
gone

Offline

 

#3 2012-11-11 15:26:33

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Inventory

This should go in Help with Scripts, so I reported it to be moved.

Also, at the moment, I can't come up with a good script.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#4 2012-11-12 15:53:54

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Inventory

In the each item's code you could add a simple script like:


if <touching [bag v]?> 

add [item_name] to [bag v]

end

You might want to make it check the item's not already in the 'bag'. You can also add the actions or animations the item performs when put in the bag in that bit of script too.


Be nice, I'm an old lady  wink

Offline

 

#5 2012-11-12 22:21:34

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Inventory

If the list contains whatever item, have it show hen you want to see it.


........................................................................................................................................................................................................................................

Offline

 

Board footer