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

#1 2012-08-11 19:32:54

radicalace
Scratcher
Registered: 2008-06-18
Posts: 85

I wonder what happens when you stack 64 if blocks within each other...

So I spent like 4 hours today working on a project.  Now what I wanted to happen was have some projectiles fire, and when they hit they stamp some debris wherever they are.  The projectiles move quickly (jump 50 pixels every frame) so often they would end up stopping past the object they hit, if you know what I mean.  This has annoyed me a lot in many projects but this time I had found a solution and wanted to implement it.  What you do is go:

if <touching?>
move [-1] steps
end
Then you have to put a whole bunch of them together so that it moves the desired amount, like so:

if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
if <touching?>
move [-1] steps
end
end
end
end
end
end
end
end
end
end
And so on and so forth.  But when I put together two giant pieces of 32 and 32, blam!  4 hours of work down the drain.

Just to make sure, I re-created this in a new project and it works every time.  So be careful!

Last edited by radicalace (2012-08-11 19:34:23)

Offline

 

#2 2012-08-11 19:35:29

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: I wonder what happens when you stack 64 if blocks within each other...

you probably overloaded Squeak's memory - be sure to save before copying huge amounts of stuff.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-08-11 19:41:19

radicalace
Scratcher
Registered: 2008-06-18
Posts: 85

Re: I wonder what happens when you stack 64 if blocks within each other...

Wes64 wrote:

you probably overloaded Squeak's memory - be sure to save before copying huge amounts of stuff.

well yeah i realize that now
by the way, i got that idea from one of your projects so i partially blame you >:3

Last edited by radicalace (2012-08-11 19:41:52)

Offline

 

#4 2012-08-12 03:03:56

benjamin2
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: I wonder what happens when you stack 64 if blocks within each other...

What happened? Did it crash the program?


http://i.imgur.com/gp6tZ.gif

Offline

 

#5 2012-08-12 13:19:41

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: I wonder what happens when you stack 64 if blocks within each other...

uh...

repeat (50)
if <touching [something v]?>
move (-1) steps
else
stop script


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#6 2012-08-12 13:28:18

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: I wonder what happens when you stack 64 if blocks within each other...

joefarebrother wrote:

uh...

repeat (64)
if <touching [something v]?>
move (-1) steps
else
stop script

He might need it to be single frame.

Offline

 

#7 2012-08-12 21:26:53

radicalace
Scratcher
Registered: 2008-06-18
Posts: 85

Re: I wonder what happens when you stack 64 if blocks within each other...

joefarebrother wrote:

uh...

repeat (50)
if <touching [something v]?>
move (-1) steps
else
stop script

does it really matter?

wait i can answer that!

no.

Offline

 

Board footer