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

#1 2012-06-19 14:06:41

MuffinFruit
New Scratcher
Registered: 2012-06-19
Posts: 5

Variable help!

Im trying to make a hunger variable and a thirst variable for my new game. Every 10 seconds its supposed to go up a point. Eating a fish or rabbit or mouse sets hunger to zero and drinking water sets thirst to zero. Lets say my hunger is 15. I eat a fish. It goes down to zero. Then 10 secs later it goes to 16! How can I fix this? Plz help.

Offline

 

#2 2012-06-19 14:11:10

MuffinFruit
New Scratcher
Registered: 2012-06-19
Posts: 5

Re: Variable help!

Heres the script I have:

when s key pressed
set hunger to (1)
and so forth all the way to forty. Then its game over.

Offline

 

#3 2012-06-20 10:01:57

skyborina
Scratcher
Registered: 2012-06-16
Posts: 1

Re: Variable help!

I need help making my dress up game. All of the games I've viewed don't seem to have any scripts!  sad

Offline

 

#4 2012-06-20 10:26:12

skippito
Scratcher
Registered: 2012-03-17
Posts: 100+

Re: Variable help!

Try these two scripts.

forever
  wait [10] secs
  change [Hunger v] by [1]
  change [Thirst v] by [1]
end
forever
  if <<touching [Fish v]?> or <<touching [Rabbit v]?> or <touching [Mouse v]?>>>
    set [Hunger v] to [0]
  end
  if <touching [Water v]?>
    set [Thirst v] to [0]
  end
end

Offline

 

Board footer