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

#1 2012-12-06 05:24:56

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

improvement on TIME blocks

they should more blocks related to time...

when gf clicked
forever if (touching sprite 2)
start (time  1)
  end
if <(time 1) > [10]>
do bla bla bla
  end
reset (time 1)
and also like

forever 
change x by [10] in every [5][seconds v]

last one is right or wrong i dont know...but some times felt need for this type of block
forever 
change x by [10] in every [2]<check>(red colour is touching blue colour)

Offline

 

#2 2012-12-06 10:43:07

dvd4
Scratcher
Registered: 2010-06-30
Posts: 1000+

Re: improvement on TIME blocks

when gf clicked
forever
change x by [10] in every [5][seconds v]
when gf clicked
forever
wait (5) secs
change x by (10)
These scripts do the same thing.

Don't support

Last edited by dvd4 (2012-12-06 10:44:39)


I made a mod  big_smile  It's called blook!
http://i49.tinypic.com/16ia63p.png

Offline

 

#3 2012-12-06 11:29:00

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: improvement on TIME blocks

Scratch is a programming language, it's meaningless to have blocks that you can program quite easily, that's the point of programming, solving problems and making things do stuff.


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#4 2012-12-06 20:50:00

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: improvement on TIME blocks

zammer990 wrote:

Scratch is a programming language, it's meaningless to have blocks that you can program quite easily, that's the point of programming, solving problems and making things do stuff.

Exactly.

The "multiple timer" suggestion can be easily done by referencing Scratch's only timer, with a list to record when our defined timers have started.

when gf clicked
reset timer
replace item (1 v) of [timers v] with (timer) //record when did our timer start
wait (1) secs
say ((timer) - (item (1 v) of [timers v])) //retrieve timer count
replace item (2 v) of [timers v] with (timer) //let's start another
(I seriously hope Scratch 2.0's timer is as precise as the online player's, i.e. doesn't only count seconds. You could make a block out of this btw, could be handy  tongue )

Last edited by technoguyx (2012-12-06 20:51:05)


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#5 2012-12-07 08:35:31

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

Re: improvement on TIME blocks

Sorry ... u miss understood a little

first of all

That

change x by (10) in  every (5)[second v] 
mean that after 2.5 sec the sprite will be 5 unit ahead..that is it will move with uniform velocity of 10 units per 5 sec
this is because when i uploaded my project on web...it went went completely wrong with its timing

to technoguyx
i just saying to make new block for times...your script is comparatively harder and what to say ..bigger...and that can be used in more neat and clean ways...

Offline

 

#6 2012-12-07 08:47:00

firedrake969_test
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: improvement on TIME blocks

The Scratch Team doesn't add workaroundable things.  Most of the time.
Programming is figuring out scripts, not using premade scripts.


Alt of Firedrake969.

Offline

 

#7 2012-12-07 10:24:15

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: improvement on TIME blocks

That's simple to do, too

repeat (10)
 change x by (1)
 wait (0.5) secs //5 / 10 = 0.5
end
Also possible for any amount of movement, in any time

set [movement v] to (150) //in pixels
set [time v] to (2) //in seconds
repeat (movement)
 change x by (1)
 wait ((time) / (movement)) secs
There's probably much better ways to do this, but this should be a nice, simple workaround. There's always the "glide" block, too.

Firedrake is right - programming is all about figuring out solutions to problems, using a set of tools (blocks, commands) given to you. If you can't figure out something in your own, you can ask the community here, in the forums. You'll be able to make custom blocks in 2.0, too.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#8 2012-12-07 10:50:59

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: improvement on TIME blocks

AmitDigga wrote:

Sorry ... u miss understood a little

first of all

That

change x by (10) in  every (5)[second v] 
mean that after 2.5 sec the sprite will be 5 unit ahead..that is it will move with uniform velocity of 10 units per 5 sec
this is because when i uploaded my project on web...it went went completely wrong with its timing

to technoguyx
i just saying to make new block for times...your script is comparatively harder and what to say ..bigger...and that can be used in more neat and clean ways...

That's what the glide block does, put it in a repeat/forever loop.


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#9 2012-12-07 18:57:51

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

Re: improvement on TIME blocks

AmitDigga wrote:

Sorry ... u miss understood a little

first of all

That

change x by (10) in  every (5)[second v] 
mean that after 2.5 sec the sprite will be 5 unit ahead..that is it will move with uniform velocity of 10 units per 5 sec
this is because when i uploaded my project on web...it went went completely wrong with its timing

to technoguyx
i just saying to make new block for times...your script is comparatively harder and what to say ..bigger...and that can be used in more neat and clean ways...

just note that real code is not usually "neat and clean" but complex and complicated, as they don't have features to do everything.

Offline

 

#10 2013-01-06 22:33:11

happyjoey2012
Scratcher
Registered: 2012-05-09
Posts: 21

Re: improvement on TIME blocks

I might as well make a maze game with one block -_-
don't support


i didn't trip i just attacked the floor with my ninja stile!

Offline

 

Board footer