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

#1 2011-04-23 06:38:44

AmitDigga
New Scratcher
Registered: 2011-04-21
Posts: 18

Is Scratch Performance alright???

Suppose when I make a Ball and set

<when green flag clicked>
<forever>
<change x by( 10 )>


<when green flag clicked>
<forever if><touching color[ Red ] >
<stop script>


And make a red object in right .
So now when I play it the Ball goes little further in the red object and then stops.
What I am saying is scratch should improve its performance foe best results.

Offline

 

#2 2011-04-23 09:56:01

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Is Scratch Performance alright???

[Stop Script] stops the script it's in. What you could do is:

[blocks]
<when green flag clicked>
<forever if><<  <not> <touching color[ Red ]>  >>
<change x by( 10 )>
<end>
[/blocks]

Last edited by Magnie (2011-04-23 09:56:58)

Offline

 

#3 2011-04-23 10:18:00

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Is Scratch Performance alright???

This has nothing to do with Scratch's performance. It overlaps with the red a little because it only checks to see if it's touching red after it moves 10 steps. Therefore, it might be not touching red but be 4 steps away, so it moves 10 steps again, finds itself in red, and stops.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2011-04-23 12:07:25

AmitDigga
New Scratcher
Registered: 2011-04-21
Posts: 18

Re: Is Scratch Performance alright???

@Harakou thanks I m more clear about scratch...but there maybe  way to stop it... because in most cases it look like a crash.

Offline

 

#5 2011-04-23 18:17:24

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Is Scratch Performance alright???

Nope, it's just the way your programmed the script.

Offline

 

#6 2011-04-23 19:20:24

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Is Scratch Performance alright???

http://i53.tinypic.com/zwnn84.gif

This gives the same performance with no overlap.

Scratch deals with following instructions to the letter, which does make it efficient, you just need to define your purpose correctly.

Last edited by Kileymeister (2011-04-23 19:21:33)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#7 2011-04-23 21:59:50

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Is Scratch Performance alright???

The "stop script" block only stops the script it is attached to.  So the second script is stopped, but not the first.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#8 2011-04-24 01:56:53

AmitDigga
New Scratcher
Registered: 2011-04-21
Posts: 18

Re: Is Scratch Performance alright???

First of all I am not talking about stop script only. Then @Kileymeister your script is looking very big and there may be a way stop it...

Offline

 

#9 2011-04-24 08:57:27

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Is Scratch Performance alright???

First, make sure the ball or the red object is greater than 10 pixels big then:
<when green flag clicked>
<forever>
   <if><touching color[ red ]>
      <stop script>
   <end>
   <change x by( 10 )>
<end>


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#10 2011-04-24 14:06:27

Jello715
Scratcher
Registered: 2008-10-11
Posts: 95

Re: Is Scratch Performance alright???

If it REALLY bothers you, once it touches the red, make the ball go in the opposite direction after it touches the red for one pixel until it's off.

The reason it goes in the red is because the sprite is moving ten pixels at a time, so unless it's 10, 20, 30, 40, etc. pixels away from the red (any number divisible by 10), it's going to go in the wall by the number of pixels in the last digit.
Let's say it's 36 pixels away, the sprite will go in 6 pixels.

Offline

 

#11 2011-04-24 14:16:53

Earthboundjeff
Scratcher
Registered: 2010-09-28
Posts: 1000+

Re: Is Scratch Performance alright???

It's not scratch's fault if you mess up.


https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcR1SONrHUmdKZXQNDgtN_vpycOOo-BDMfnlqHZRA1lMpYXhX7Jc

Offline

 

#12 2011-04-24 20:20:50

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Is Scratch Performance alright???

One thing programming has taught me: it is always my fault, no matter how much I want it to be the computers  sad


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer