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

#1 2007-08-29 15:59:59

RafBern
Scratcher
Registered: 2007-06-12
Posts: 7

Making an object shrink

How do I make an object shrink as I press the down button and then get bigger when I press the up button?

Offline

 

#2 2007-08-29 16:09:27

RafBern
Scratcher
Registered: 2007-06-12
Posts: 7

Re: Making an object shrink

I also have another question:
How do I make an object randomly appear on 6 parts of the screen (one at a time) at a different size depending on the part of the screen and then walk across it and dissappear at a different point?

Offline

 

#3 2007-08-29 16:15:25

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Making an object shrink

For the growth/shrinking part of both queastions, experiment with the "Size" block in the looks menu.

For random locations, investigate the "Pick Random" block in the numbers menu, and combine it with the goto command.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#4 2007-08-29 16:22:51

RafBern
Scratcher
Registered: 2007-06-12
Posts: 7

Re: Making an object shrink

I figured out the answer to my first question.  But do you have an idea how I could make it stop at a certain size when getting bigger and when getting smaller?

[blocks]
<when[up]key pressed>
<change size by(2

<when[down]key pressed>
<change size by(-2


[/blocks]

Last edited by RafBern (2007-08-29 16:23:43)

Offline

 

#5 2007-08-29 16:25:27

RafBern
Scratcher
Registered: 2007-06-12
Posts: 7

Re: Making an object shrink

Thanks Mayhem

Last edited by RafBern (2007-08-29 19:13:46)

Offline

 

#6 2007-08-29 20:15:45

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

Re: Making an object shrink

RafBern wrote:

I figured out the answer to my first question.  But do you have an idea how I could make it stop at a certain size when getting bigger and when getting smaller?

[blocks]
<when[up]key pressed>
<change size by(2

<when[down]key pressed>
<change size by(-2


[/blocks]

Just subitute maxsize and minsize for the size limits

[blocks]
<when[up]key pressed>

<if><( <size> <<> <{ maxsize }> )>
<change size by(2

<when[down]key pressed>

<if><( <size> <>>  <{ minsize }>)>
<change size by(-2


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

 

Board footer