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

#1 2011-04-15 04:53:41

GameDesigner
New Scratcher
Registered: 2010-07-19
Posts: 8

help (doesn't work)

Hello, I would ask you one question please.

I'm doing now a game in scratch.. it's about 3 boxes in the left, and the player have to drag and drop it in the right place.
I want if the player drag and drop the first and the second in the third box in the right place, then switch background custom and show sprite"you win!".

but I have a problem, i programmed as:

if "box1" touching (yepbox1).. set variable to 1

if "box2" touching (yepbox2).. set variable to 2

if "box3" touching (yepbox3).. set variable to 3

if variable = 3 go to change box's custom

then

if "box1" touching (color#).. set variable to 4

if "box2" touching (color#).. set variable to 5

if "box3" touching (color#).. set variable to 6

if variable = 6 go to change broadcast "the end"

the problem is: if the player first drag and drop box3, the variable will be 6 and the will end with out dragging and dropping the box1&2!!


And thank you.

Offline

 

#2 2011-04-15 04:59:34

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: help (doesn't work)

Link to game?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#3 2011-04-15 05:03:22

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: help (doesn't work)

Anyway, 
if "box1" touching (yepbox1).. set variable to 1

if "box2" touching <(yepbox2) and <(Variable)=1> >THIS MAKES SURE THEY HAVE TO PLAC E IN box1 FIRST!.. set variable to 2

if "box3" touching (yepbox3) and <(variable)=2> .. set variable to 3

if variable = 3 go to change box's custom

then

if "box1" touching <(color#) and <(variable)=3> >.. set variable to 4

if "box2" touching <(color#) and <(variable)=4> >.. set variable to 5

if "box3" touching <(color#) and <(variable)=5> >.. set variable to 6

if variable = 6 go to change broadcast "the end"

This is the code you need to use, it' detects the previous setting of the variable  wink


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#4 2011-04-15 14:13:55

GameDesigner
New Scratcher
Registered: 2010-07-19
Posts: 8

Re: help (doesn't work)

this: http://scratch.mit.edu/projects/GameDesigner/1726264

but I don't want from the player to drag and drop box1 then box2 then box3
I want if he drag and drop any box (1 or 2 or 3) but should drag and drop all the boxes

Offline

 

Board footer