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

#1 2013-04-07 10:39:09

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Help with flashing

I've made a spring simulator and GoL simulator. Yay, right? Works awesomely in the old flash player - But only the old. In the new flash player/2.0 player, the parts of the spring and the cells always flash as they're repeatedly cleared and redrawn. Any ideas on how to stop then from flashing?
(Can't unroll the script)


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#2 2013-04-08 17:50:56

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Bump. (EDIT: 5 times, inc this one)

Last edited by Hyperbola (2013-04-15 17:53:27)


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#3 2013-04-12 18:23:46

dusty22
Scratcher
Registered: 2012-09-28
Posts: 49

Re: Help with flashing

If you didn't bump your topic so much, I wouldn't have thought 5 people already replied to it!

Why don't you post a link to your project and we'll see if it happens for us too.

Offline

 

#4 2013-04-13 16:50:17

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

I can't exactly delete the bumps...
I'm not one to share my in progress projects, so try this script instead:

when gf clicked
delete (all v) of [X v]
when key [space v] pressed
add (pick random (-240) to (240)) to [X v]
set [# v] to [1]
clear
repeat (length of [X v])
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
In the old flash player, it can get up to 400 before flashing. But in the new player, it only gets to 100. In the offline version, it goes to at least 200, but I can't test any further.

How do I fix things like this?


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#5 2013-04-13 18:28:57

Liamadams
Scratcher
Registered: 2012-12-08
Posts: 100+

Re: Help with flashing

how to do the length of?  yikes 

(length of [ ])


http://i39.tinypic.com/3309476.jpg

Offline

 

#6 2013-04-14 09:45:00

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Bump.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#7 2013-04-14 10:10:32

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: Help with flashing

Liamadams wrote:

how to do the length of?  yikes 

(length of [ ])

It's a list block

(length of [list v])


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

#8 2013-04-15 17:53:54

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Bump.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#9 2013-04-17 16:23:09

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Bump.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#10 2013-04-18 12:22:29

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Help with flashing

You could try repeating the script in the repeat length of x section so that in each section of the repeat it does it multiple times. You'd need to do edit the repeat code a bit and do a repeat mod of length of x / # afterwards but it might help.

Example:


when gf clicked
delete (all v) of [X v]
set [Multiples v] to [3]
when key [space v] pressed
add (pick random (-240) to (240)) to [X v]
set [# v] to [1]
clear
if <(length of [X v]) < (Multiples)>
repeat (length of [X v])
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
else
repeat <<(length of [X v]) / (Multiples)> - <<(length of [X v]) / (Multiples)> mod (Multiples)>>
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
repeat <<(length of [X v]) / (Multiples)> mod (Multiples)>
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
end
Sadly although this can speed it up I suspect there would still be a lot of flashing. The higher the Multiples variable is set the better the result though.

Last edited by Smozzick (2013-04-18 12:34:38)


http://i50.tinypic.com/ded8m.png

Offline

 

#11 2013-04-18 16:24:18

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Smozzick wrote:

You could try repeating the script in the repeat length of x section so that in each section of the repeat it does it multiple times. You'd need to do edit the repeat code a bit and do a repeat mod of length of x / # afterwards but it might help.

Example:


when gf clicked
delete (all v) of [X v]
set [Multiples v] to [3]
when key [space v] pressed
add (pick random (-240) to (240)) to [X v]
set [# v] to [1]
clear
if <(length of [X v]) < (Multiples)>
repeat (length of [X v])
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
else
repeat <<(length of [X v]) / (Multiples)> - <<(length of [X v]) / (Multiples)> mod (Multiples)>>
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
repeat <<(length of [X v]) / (Multiples)> mod (Multiples)>
replace item (#) of [X v] with ((item (#) of [X v]) + (1))
set x to (item (#) of [X v])
stamp
change [# v] by (1)
end
end
Sadly although this can speed it up I suspect there would still be a lot of flashing. The higher the Multiples variable is set the better the result though.

Hyperbola wrote:

(Can't unroll the script)


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#12 2013-04-19 16:26:33

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Bump.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#13 2013-04-19 17:22:19

Liamadams
Scratcher
Registered: 2012-12-08
Posts: 100+

Re: Help with flashing

7734f wrote:

Liamadams wrote:

how to do the length of?  yikes 

(length of [ ])

It's a list block

(length of [list v])

its a list block and an operators block. how foolish you are!


http://i39.tinypic.com/3309476.jpg

Offline

 

#14 2013-04-19 17:23:48

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Liamadams wrote:

7734f wrote:

Liamadams wrote:

how to do the length of?  yikes 

(length of [ ])

It's a list block

(length of [list v])

its a list block and an operators block. how foolish you are!

Try using scratchblocks to show length of [my name is v], as in my name is the letter v, in a string.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#15 2013-04-20 19:10:40

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Bump.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#16 2013-04-20 19:31:35

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Help with flashing

Read the can't unroll the script bit already, just thought you couldn't do it because of variable length.

Why? Too long and freezes or?

Last edited by Smozzick (2013-04-20 19:32:07)


http://i50.tinypic.com/ded8m.png

Offline

 

#17 2013-04-20 19:48:24

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Smozzick wrote:

Read the can't unroll the script bit already, just thought you couldn't do it because of variable length.

Why? Too long and freezes or?

Well, for one it's not really elegant, and also, it will make attempts to edit it difficult, laggy, and/or tedious.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#18 2013-04-20 20:00:00

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Help with flashing

Hyperbola wrote:

Smozzick wrote:

Read the can't unroll the script bit already, just thought you couldn't do it because of variable length.

Why? Too long and freezes or?

Well, for one it's not really elegant, and also, it will make attempts to edit it difficult, laggy, and/or tedious.

True; but you won't find many elegant methods to speed up execution of  a script like this in scratch - that's why the unrolling method exists.

As for editing...fair enough. Keep looking for other solutions in the meantime but if unrolling it in that way does speed it up then you might want to use it once you've finished making the rest of the program.

---

I was going to suggest trying to put the item # of X in a variable to reduce processing when its retrieving the number from the list but from a quick test it doesn't seem to help. Maybe worth a try anyway?

---

Other than that I'll keep thinking but nothing really strikes me. Good luck with it though.


http://i50.tinypic.com/ded8m.png

Offline

 

#19 2013-04-20 21:03:07

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Help with flashing

Smozzick wrote:

Hyperbola wrote:

Smozzick wrote:

Read the can't unroll the script bit already, just thought you couldn't do it because of variable length.

Why? Too long and freezes or?

Well, for one it's not really elegant, and also, it will make attempts to edit it difficult, laggy, and/or tedious.

True; but you won't find many elegant methods to speed up execution of  a script like this in scratch - that's why the unrolling method exists.

As for editing...fair enough. Keep looking for other solutions in the meantime but if unrolling it in that way does speed it up then you might want to use it once you've finished making the rest of the program.

---

I was going to suggest trying to put the item # of X in a variable to reduce processing when its retrieving the number from the list but from a quick test it doesn't seem to help. Maybe worth a try anyway?

---

Other than that I'll keep thinking but nothing really strikes me. Good luck with it though.

Thanks  smile  I'm working on a new project right now though that doesn't have this problem.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

Board footer