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

#1 2007-06-13 13:38:01

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

How could I ...

How could I say, click on a sprite (a square) of a certain colour and then click on a different sprite so that it changes colour to the same of the square?
What code would I need, (if it's possible?)


Be nice, I'm an old lady  wink

Offline

 

#2 2007-06-13 13:59:56

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How could I ...

{colour square green}
when greensquare clicked set colourno to 2 {2 represents green}

{spritesquare change its colours!}

when spritesquare pressed

if colourno=1
switch to costume red


if colourno=2
switch to costume green

and so on


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2007-06-13 15:21:08

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: How could I ...

Take a look at how I did the color changes for pegs in my MasterMind game:
http://scratch.mit.edu/projects/kevin_karplus/12236

Offline

 

#4 2007-06-16 10:09:05

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: How could I ...

Thanks guys! I'm going to try it now  smile


Be nice, I'm an old lady  wink

Offline

 

#5 2007-06-16 12:23:42

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: How could I ...

Thanks it works!!! smile  smile  smile  smile  smile


Be nice, I'm an old lady  wink

Offline

 

Board footer