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

#1 2013-01-08 07:49:33

Sharpstick
New Scratcher
Registered: 2013-01-08
Posts: 1

Collection Capacity

Hello all,

Been creating a game in Scratch where a robot moves around a grid and depletes energy according to the movements. I have 9 different sprites for the different types of robots. The robots have an energy variable which depletes when they move.

I now want to add some sprites for them to "collect". The aim of the game is to rescue all people and return to a base sprite.

The issue I have is that I create the sprites, put them on the map and I want to make it so that each robot has a different capacity. I've created a capcity variable but when the robot deposits the first lot of passengers off and the capcity is reset to 0 no other passengers will be collected.

Anyone have an idea of what sorta script I could use?

Thanks

Offline

 

#2 2013-01-08 14:59:34

Kileymeister_test
Scratcher
Registered: 2010-01-31
Posts: 100+

Re: Collection Capacity

Maybe give each robot a variable and a list, make the variable set to the maximum amount of passengers a robot can carry.  Whenever a robot picks up a passenger it adds a slot to the list.  Then when the length of the list = capacity, it can no longer pick up passengers.  When depositing the first load, just clear the whole list but do not change the capacity variable.


Kileymeister's test account.  I upload engines and demos and stuff for public use.
Currently Working on: Grapple Arms!

Offline

 

#3 2013-01-09 06:46:10

ethwok
Scratcher
Registered: 2012-09-10
Posts: 100+

Re: Collection Capacity

Kileymeister_test wrote:

Maybe give each robot a variable and a list, make the variable set to the maximum amount of passengers a robot can carry.  Whenever a robot picks up a passenger it adds a slot to the list.  Then when the length of the list = capacity, it can no longer pick up passengers.  When depositing the first load, just clear the whole list but do not change the capacity variable.

ha, I was gonna put about the same thing and was typing it until I saw this


http://displaypicks.com/wp-content/uploads/2013/01/Animals-12.jpg
I AM ETHWOK

Offline

 

Board footer