I really hate it when I find that I keep repeating code. When there is a problem with it, I have to change all the pieces of code. In scratch 1.5 I'd like a way round this. (Is there already one?)
Offline
In Scratch 2.0, the next version, you'll be able to create blocks and then you'll just be able to change the code for the block as opposed to everywhere.
Offline
Meanwhile, it is a good idea to use broadcasts for more complicated functions that need to be repeated multiple times. Here is an example of what i mean using simpler blocks:
when gf clicked // main script move (10) steps broadcast [flip v] and wait say [hey!] for (2) secs broadcast [flip v] and wait next costume broadcast [flip v] and wait when i receive [flip v]// this is the function that needs to be repeated repeat (36) turn cw (10) degrees endAnd then, if you need to change the speed of the flip or decide that you'd rather jump instead of flipping, you only need to change it once (in the second script)!
Last edited by LS97 (2012-04-26 11:31:07)
Offline