Hello, all.
First of all, and because it is my first post, Many thanks to Scratch's developer team for doing it! I worked with LOGO long ago, but this is acres more fun.
Having said that, and because I feel it is an excelent tool I will pass to my own children's computer class teachers, I also feel urged to contribute to it's development.
I have detected a bug with a little game called "Space Blawrs", find it here
http://scratch.mit.edu/projects/albertus/4630
So I have a script to reset the asteroid when it touches the edges of the screen, but it doesn't, or does so in an erratic way.
Please try it out and if you can improve this behaviour it would be nice.
I have more things to share, but I will do so on the sugestions thread.
3 cheers to MIT and Scratch's develolopers from Lisboa, Portugal.
Offline
The problem is that you have three instances of "forever move 1 step"
Keep only the first one on your first when-green-flag script.
Change the other green-flag script to
when green-flag clicked
forever
wait pick random ...
if touching edge
goto random ..
point in direction random ...
show
This seems to be the minimal change that will do pretty much what you want.
Note: I put the wait before the if-touching-edge so that you don't get stuck on the top edge.
Offline
That looks like it works too. I made the change I mentioned above and it seemed to work for me.
[when green flag clicked]
[forever]
[ if <touching [edge] ? > ]
[ go to x: ( pick random (-230) to (230) ) y: (195) ]
[ point in direction (pick random (140) to (220) ]
[show]
[ repeat until < not < touching [ edge ] ? > >
[ move (1) steps ]
The forever loop keeps the edge collision check from running a second time so I think that is the important thing to get rid of.
Offline