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

#1 2011-10-16 16:42:12

rakel87
New Scratcher
Registered: 2011-03-15
Posts: 10

New functions in SCRATCH

Hello!
I am implementing new functions in SCRACTH. I need to know where or how I should call a function to be executed each 5 seconds
thanks

Offline

 

#2 2011-10-16 17:56:33

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: New functions in SCRATCH

you mean like
[blocks]
<when green flag clicked>
<forever>
do something
<wait( 5 )secsc>
<end>


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#3 2011-10-16 18:00:28

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: New functions in SCRATCH

or do you mean in squeak

Code:

Insert Complicated code here

http://i.imgur.com/zeIZW.png

Offline

 

#4 2011-10-17 15:41:12

rakel87
New Scratcher
Registered: 2011-03-15
Posts: 10

Re: New functions in SCRATCH

I need the code for the Squeak

Offline

 

#5 2011-10-17 16:24:35

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: New functions in SCRATCH

Use stepping.

Add a method called stepTime and set it (in milliseconds) to the time interval, and then a method called "step: evt" to execute the code.

Offline

 

Board footer