Discuss Scratch

NoMod-Programming
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

I decided to delve back into the old 1.x days of Scratch (back when it ran on Squeak), and thought about looking into the “Water Ripple” effect and why it didn't work. According to the Scratch Wiki:

Scratch Wiki wrote:

There was also a water ripple effect, which crashed Scratch due to the system not having enough memory

Well, looking into the source, I noticed that out of bounds reads and writes were occurring within the following lines of code:

	for (q = 0; q <= (width * height); q += 1) {
		temp = bArray[q];
		bArray[q] = (aArray[q]);
		aArray[q] = temp;
	}

If you didn't notice the issue, it's the <= comparison used for checking that the variable “q” is between 0 and (width * height). Because arrays bArray and aArray are 0-indexed, though, the last element, at width * height, doesn't exist. So the code crashed every time it tried looping over the final element. The fix to this, therefore, was to replace the <= comparison with the < operator, such as in the following snippet:

	for (q = 0; q < (width * height); q += 1) {
		temp = bArray[q];
		bArray[q] = (aArray[q]);
		aArray[q] = temp;
	}

That one character fix gets the “water ripple” effect working (after recompiling the plugin), and it can be seen in the following gif:


Long-since moved on from Scratch, if you need to find all my posts, search this in google: 3499447a51c01fc4dc1e8c3b8182b41cb0e88c67
Maximouse
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

Interesting! Someone should correct the wiki article then.


This is Maximouse's signature. Learn more about signatures.
Jeffalo
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

imagine how different scratch might have been if they didn't mess that up.

for compatibility i'm guessing they would keep the water ripple effect… which might have changed a lot of things. we might have had more advanced effects and stuff. wow!

disclaimer: sometimes my posts are pretty critical of the scratch team (especially my older ones), but i really do scratch & scratch team. jvvg made a short essay thing about the scratch team, which is a pretty good read, if you want a different perspective for the scratch team's actions.

my website: jeffalo.net | ocular: scratch forum search













CatsUnited
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

Jeffalo wrote:

imagine how different scratch might have been if they didn't mess that up.
I could see a lot of people using this in their projects as cool glitch effect woah

bottom text
Bacteria999
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

bump
FunE552
Scratcher
8 posts

Water Ripple effect from Scratch 1.x

i found a project called instant scratch crasher that contains a block that is an effect set that has the option chosen for water ripple effect, it does nothing but is a cool relic and i put it in my backpack so i always have id

ps: i am not lying go there right now
ninjaMAR
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

Cool! I hope the ST sees this and re-adds it

Raihan142857
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

ninjaMAR wrote:

Cool! I hope the ST sees this and re-adds it
Haha, the ST never adds anything. Also why did @FunE552 necropost thats not cool

I use scratch.
GF: I'll dump you. BF: hex dump or binary dump?










CatsUnited
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

Raihan142857 wrote:

Also why did @FunE552 necropost thats not cool
because it is cool?

bottom text
nekoender
Scratcher
100+ posts

Water Ripple effect from Scratch 1.x

I'm using the system browser thing in 1.x to fix it. where is this line of code?
	for (q = 0; q <= (width * height); q += 1) {
temp = bArray[q];
bArray[q] = (aArray[q]);
aArray[q] = temp;
}

Hey there! Neko here.
I'm an Idiot on this site who wants to have fun and do stuff.
Music Maker, Artist, Memer, Etc.
Extended Bio: https://scratch.mit.edu/studios/32013026/
when green flag clicked
follow user [nekoender] :: sensing

Please follow nekoender to see more content from him!

yeah idk what else to put here lol
Maximouse
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

nekoender wrote:

I'm using the system browser thing in 1.x to fix it. where is this line of code?
	for (q = 0; q <= (width * height); q += 1) {
temp = bArray[q];
bArray[q] = (aArray[q]);
aArray[q] = temp;
}
It's in a plugin, so you can't change it in the editor itself.


This is Maximouse's signature. Learn more about signatures.
flyingtrain322
Scratcher
18 posts

Water Ripple effect from Scratch 1.x

Is there any way to use the plugin file or does it do it automatically?

This is a signature. You can edit this on the bottom of the discuss scratch home page.
RSITYTScratch
Scratcher
100+ posts

Water Ripple effect from Scratch 1.x

flyingtrain322 wrote:

Is there any way to use the plugin file or does it do it automatically?
Don't necropost.

Generation X (10): the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.

A BIG WAVE OF NOTIFICATIONS AHHHHHH-


Hello, I'm RSITYT! I am a autistic 11 year old who is known for making Find the Squares.

Here's a game that I been working on: Find the Squares: The Fruit Named Husa, and yes, you can advertise your game in your sig.

do not check some of my old posts please i am absolutely embarrassed at some posts i made






when @greenFlag misclicked::events :: hat
check everywhere::sensing
wait (0.01) seconds::control
self-destruct::control :: cap
Please set a status at Ocular by clicking the below image, to make @Jeffalo happy! #OcularStatusesTo2k























Oh, you won't see this without pressing Ctrl+Shift+Down!
CST1229
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

RSITYTScratch wrote:

(#13)

flyingtrain322 wrote:

Is there any way to use the plugin file or does it do it automatically?
Don't necropost.
I wouldn't call that a necropost because it is related to the topic and is not spam or anything like that.

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



ScratchCatHELLO
Scratcher
1000+ posts

Water Ripple effect from Scratch 1.x

RSITYTScratch wrote:

flyingtrain322 wrote:

Is there any way to use the plugin file or does it do it automatically?
Don't necropost.

I don’t think it’s possible to necropost in Advanced Topics.





ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust



Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y
Andricxa
Scratcher
88 posts

Water Ripple effect from Scratch 1.x

new effects
change [water ripple v] effect by (25)
change [blur v] effect by (25)
tyson4621
Scratcher
29 posts

Water Ripple effect from Scratch 1.x

set [WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW v] effect to (WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWw)
just use that

Powered by DjangoBB