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

#1 2012-10-01 18:03:14

Scrap16
New Scratcher
Registered: 2012-10-01
Posts: 2

light, simple, inventory system. need some help

im new to Scratch, and any kind of game programming, and iv been trying for 2 days to get this simple thing to work.

i want my sprite to able to walk around and pick up these little black box sprites and then drop them where he needs, he can have a max of 5 at a time, and needs to have picked some up before he can drop them, they need to disapear when he picks them up.

i got the picking up part, when hes touching the color, they dispear, and then i go to place it, and it sort of works, but they ALL go to the spot wheres hes at, not just the one i "picked up"".

any helps or tips would be a appreciated

Offline

 

#2 2012-10-02 00:19:09

tweedledum101
Scratcher
Registered: 2012-05-20
Posts: 27

Re: light, simple, inventory system. need some help

Working on it.


http://img835.imageshack.us/img835/9295/5646133d1a8c695m3.gif

Offline

 

#3 2012-10-02 06:58:10

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: light, simple, inventory system. need some help

Knowing how you've scripted it it would help.

Assuming you are using 5 sprites for the black boxes I imagine that you have a script in each for if touching pick up. I also imagine that you have something like 'if I receive [Space Key] then drop on all sprites; the problem with that being that there is nothing telling it which to drop.

The simplest solution I can see is to have a list that you store the name of the sprite in when you pick it up and when you press the space key (to drop the item) it says 'if item [1] of List is SpriteName then drop and delete SpriteName from List.

---

Example Project: Link to Project

Last edited by Smozzick (2012-10-02 07:19:03)


http://i50.tinypic.com/ded8m.png

Offline

 

Board footer