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

#1 2010-03-04 20:49:41

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Combination Script?

I need a script for a certain surprise game I'm making. Basically, I need it so that a certain pattern equals one thing. I think it will be best explained with a diagram.

Let's say, I was combining paints virtually.

Red + Yellow + Blue = Brown

Right? Now what I'm wondering is how I make that happen with scratch.

It needs to be so that:

Red + Yellow + Blue

Is also the same as

Yellow + Blue + Red

Or

Blue + Red + Yellow

See what I mean? There will also be other colors too like

Pink + White = Light Pink

Can someone develop a script for that please? I will be very gratful and give credit.

Offline

 

#2 2010-03-04 20:58:17

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: Combination Script?

{When flag clicked}
FOREVER
[if mouse down and touching [whatever color]
add [whatever color] to [whatever list]
[end if]
[if mouse down and touching whatever sprite]
clear [whatever list]
[end if]
END FOREVER

[When flag clicked]
[if [whatever list] contains [whatever color] and [whatever color] etc.]
switch [whatever controls the color] to [whatever color]
[end if]

Repeat this for every color:
[if mouse down and touching [whatever color]
add [whatever color] to [whatever list]
[end if]

Repeat this for every combination:
[if [whatever list] contains [whatever color] and [whatever color] etc.]
switch [whatever controls the color] to [whatever color]
[end if]

HOPE THIS HELPS!!!  smile   smile   smile


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#3 2010-03-04 23:04:08

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: Combination Script?

soupoftomato wrote:

{When flag clicked}
FOREVER
[if mouse down and touching [whatever color]
add [whatever color] to [whatever list]
[end if]
[if mouse down and touching whatever sprite]
clear [whatever list]
[end if]
END FOREVER

[When flag clicked]
[if [whatever list] contains [whatever color] and [whatever color] etc.]
switch [whatever controls the color] to [whatever color]
[end if]

Repeat this for every color:
[if mouse down and touching [whatever color]
add [whatever color] to [whatever list]
[end if]

Repeat this for every combination:
[if [whatever list] contains [whatever color] and [whatever color] etc.]
switch [whatever controls the color] to [whatever color]
[end if]

HOPE THIS HELPS!!!  smile   smile   smile

Err...


What?

Offline

 

#4 2010-03-05 19:31:15

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: Combination Script?

Bump  hmm

Offline

 

#5 2010-03-21 13:28:40

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: Combination Script?

Bump  yikes

Offline

 

#6 2010-03-21 13:41:55

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Combination Script?

You can try what soupoftomato said. Í'll make a project with that for you.


Hai.

Offline

 

#7 2010-03-21 14:03:21

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: Combination Script?

fg123 wrote:

You can try what soupoftomato said. Í'll make a project with that for you.

Thanks. I really don't understand things like that  hmm

Offline

 

Board footer