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

#1 2008-10-08 20:44:52

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Buffered Motion Using Lists

Here is another interesting use of lists.  I developed a color-sensing bouncing ball project that can bounce off arbitrarily oriented curved lines.  However, the bounce logic caused a perceptable lag in the motion.  My solution was to create an invisible guide ball that computes the motion ahead of the ball that the user sees.  The motion is stored in a list that the visible ball follows smoothly.  I think it looks pretty good; however there is a bit of a lag when the simulation starts as the buffer fills.

http://scratch.mit.edu/projects/Paddle2SeeFixIt/285855

And another example,

http://scratch.mit.edu/projects/Paddle2SeeFixIt/286655


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#2 2008-10-09 02:00:39

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Buffered Motion Using Lists

This really is an awesome and very clever use of lists to accomplish a baffling performance-increase for all "bouncing balls" projects out there. It also shows that Scratch has many techniques (like buffering an parallelism) which let you increase performance for complex operations without having to tweak Scratch itself. Thanks for this great example, Paddle2See!


Jens Mönig

Offline

 

#3 2008-10-09 04:32:59

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Buffered Motion Using Lists

Jens wrote:

This really is an awesome and very clever use of lists to accomplish a baffling performance-increase for all "bouncing balls" projects out there. It also shows that Scratch has many techniques (like buffering an parallelism) which let you increase performance for complex operations without having to tweak Scratch itself. Thanks for this great example, Paddle2See!

Thanks Jens - but please note that this technique will only work with bouncing balls in a static environment.  It would not work for a pinball game for instance, since the moving flippers create a dynamic change to the environment that the guide ball could not anticipate.  However, it might be possible to create a hybrid version of this technique that uses the buffer most of the time but also responds to environment changes that impact the visible ball.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2008-10-09 05:13:53

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Buffered Motion Using Lists

...well, in a pinball game a little delay in bouncing could even be considered a cool visual effect, so I'd just call it a feature in fond memory of your previous signature-quote, lol!


Jens Mönig

Offline

 

#5 2008-10-09 11:46:20

registeel
Scratcher
Registered: 2008-04-27
Posts: 500+

Re: Buffered Motion Using Lists

I'm just wondering (sorry if it's spam) do you ever use paddle2seefixit to go on forums?

Offline

 

#6 2008-10-09 12:19:40

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Buffered Motion Using Lists

registeel wrote:

I'm just wondering (sorry if it's spam) do you ever use paddle2seefixit to go on forums?

I try not to.  Paddle2See is my more public account.  I use the "FixIt" account for fixing other people's projects, testing my own stuff, and isolating bugs.  I don't log on to it every day so I don't want a lot of communication traffic on it.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer