Discuss Scratch

FreshTheCat
Scratcher
1000+ posts

Scratch Workaround Guide VII

ezriha wrote:

(#517)
Is there any workaround for a “pause timer” block?
[pause v] timer :: sensing
I’m thinking it would have to use a timer workaround like the one listen on the Scratch Wiki’s article for workarounds but that takes use of the days since 2000 reporter and thus to make a timer able to be paused, you’d have to make a days since 2000 reporter able to be paused. And then if you take reset timer into account, assuming timer is still paused after resetting, you have to modify the pause timer. I assume it would be some sort of on/off switch for the timer, where the days since 2000 block is replaced with a variable acting the same way.
when green flag clicked
forever
if <(timermode) = [on]> then
set [timer 2 v] to ((dayssince2K) insert code here (timestamp))
else
set [dayssince2K v] to ((days since 2000) insert some code here (timestamp))
end
end
(small bad mockup)
I think it's as easy as having
//UNTESTED!!!
define //run without screen refresh
forever
repeat until <(foo) = [pause]>
set [timer v] to ((timer) - (offset))
end
repeat until <(foo) = [play]>
wait (0.001) secs
change [offset v] by (0.001)

end
end
ezriha
Scratcher
40 posts

Scratch Workaround Guide VII

FreshTheCat wrote:

ezriha wrote:

Insert what I said here
I think it's as easy as having
//UNTESTED!!!
define //run without screen refresh
forever
repeat until <(foo) = [pause]>
set [timer v] to ((timer) - (offset))
end
repeat until <(foo) = [play]>
wait (0.001) secs
change [offset v] by (0.001)

end
end

That definitely works, but the constant updating of the timer variable lags a lot (I tested, it's legitimately really laggy)
It lags so much, in fact, that it slows down the offset from counting up by 0.001. Essentially, having it “run without screen refresh” breaks it.
Turning it off, the offset counting up is still slow to the point where it doesn't count fast enough, but it's faster than it was before.
ScodexPerson
Scratcher
1000+ posts

Scratch Workaround Guide VII

I think that a workaround guide for non-block related suggestions is gonna be useful.
ScodexPerson
Scratcher
1000+ posts

Scratch Workaround Guide VII

I also have a workaround for this block:
<when key (... v) held for () seconds? :: sensing>

Which is:
define Key (key) pressed for (seconds) secs
if <key (key) pressed?> then
if <((days since 2000) * (86400)) > ((Daysince2000) + (delay :: grey))> then // delay should be around 1.5 secs
set [Daysince2000 v] to ((days since 2000) * (86400))
end
if <(((days since 2000) * (86400)) + (seconds)) > (Daysince2000)> then
...
end
end

Last edited by ScodexPerson (March 19, 2026 13:08:55)

Scungilio64
Scratcher
500+ posts

Scratch Workaround Guide VII

ScodexPerson wrote:

I also have a workaround for this block:
<when key (... v) held for () seconds? :: sensing>

Which is:
define Key (key) pressed for (seconds) secs
if <key (key) pressed?> then
if <((days since 2000) * (86400)) > ((Daysince2000) + (delay :: grey))> then // delay should be around 0.05-0.5 secs
set [Daysince2000 v] to ((days since 2000) * (86400))
end
if <(((days since 2000) * (86400)) + (seconds)) > (Daysince2000)> then
...
end
end
why do you need to use days since 2000?
ScodexPerson
Scratcher
1000+ posts

Scratch Workaround Guide VII

Scungilio64 wrote:

ScodexPerson wrote:

snip
why do you need to use days since 2000?
That's one of the most accurate sensing blocks that can display seconds and even milliseconds.
And i already multiplied it by 86400 so that it displays seconds since 2000.
Cheezzychiknzzz
Scratcher
500+ posts

Scratch Workaround Guide VII

ScodexPerson wrote:

I also have a workaround for this block:
<when key (... v) held for () seconds? :: sensing>

Which is:
define Key (key) pressed for (seconds) secs
if <key (key) pressed?> then
if <((days since 2000) * (86400)) > ((Daysince2000) + (delay :: grey))> then // delay should be around 1.5 secs
set [Daysince2000 v] to ((days since 2000) * (86400))
end
if <(((days since 2000) * (86400)) + (seconds)) > (Daysince2000)> then
...
end
end
But this isn't a logic variable, how are you going to use this in equations?

Last edited by Cheezzychiknzzz (March 26, 2026 12:32:44)

0_009
Scratcher
1000+ posts

Scratch Workaround Guide VII

ok why on earth does this topic exist
(atan2 ()/()::operators)
([atan v] of (()/())::operators)
It's not a perfect workaround, but it still works!
mtnif
Scratcher
1000+ posts

Scratch Workaround Guide VII

can i make a new topic because the owner of this topic went inactive for two months
nbcoder62
Scratcher
41 posts

Scratch Workaround Guide VII

hi
ScodexPerson
Scratcher
1000+ posts

Scratch Workaround Guide VII

mtnif wrote:

can i make a new topic because the owner of this topic went inactive for two months
You always want to take a sticky over if the owner is inactive. Please let other people also have stickies.
0_009
Scratcher
1000+ posts

Scratch Workaround Guide VII

nbcoder62 wrote:

hi
Well hello there!
benegam
Scratcher
92 posts

Scratch Workaround Guide VII

mtnif wrote:

can i make a new topic because the owner of this topic went inactive for two months
this comment just makes it sound like they are taking a break. wait more before trying to make a new topic.

Last edited by benegam (March 28, 2026 21:15:13)

Minuute_
Scratcher
8 posts

Scratch Workaround Guide VII

Announcement My fellow scratchers! Originally @Griffpatch has made their fair share of movement code for the epic ray casting!

This was the movement code:

define X (val)
repeat (10)
change x by ((val) / (10))
if <touching [wall v] ?> then
stop [this script v]
end
end

This was originally meant for only non-camera movement, also it was only a matter of time until they switched to 3D

But besides from that, how would you use this system with…

(CamX) (Cam Y)

Originally I posted a project about this, but it ended up not working, because I used @Griffpatch 's advice!

But I got a way around it!

define MoveX (value)
change [x v] by (value)
go to x: ((x) - (CamX)) y: (not included)
if <touching [wall v] ?> then
repeat until <not <touching [wall v] ?>
if <(value) > [0]> then
change [ x v] by (-1)
else
change [ x v] by (1)
end
go to x: ((x) - (CamX)) y: (not included)
end
end

And the same for Y

But this way, we can now use the camera axis!!!

Last edited by Minuute_ (March 29, 2026 05:26:54)

0_009
Scratcher
1000+ posts

Scratch Workaround Guide VII

(position::motion)//block from Snap!/BYOB

when flag clicked
delete all of [position v]//list is set to "for this sprite only"
add (x position) to [position v]
add (y position) to [position v]
forever
replace item (1) of [list v] with (x position)
replace item (2) of [list v] with (y position)
end
I hope that helps!
jmdzti_0-0
Scratcher
1000+ posts

Scratch Workaround Guide VII

0_009 wrote:

~snip~
I hope that helps!
i
forever loops are very costly to maintain. it is best that if you really need to use both at the same time you use the join block

Last edited by jmdzti_0-0 (March 31, 2026 21:43:37)

Kairo_konatu
Scratcher
49 posts

Scratch Workaround Guide VII

I'd like to request an increase in the maximum size of the eraser. (For example, changing the maximum size from 1 to 0.1.) (I can't read English, so I might have posted this in the wrong place or made a mistake with the wording, please forgive me.)
Kairo_konatu
Scratcher
49 posts

Scratch Workaround Guide VII

I'd like to request an increase in the maximum size of the eraser. (For example, changing the maximum size from 1 to 0.1.) (I can't read English, so I might have posted this in the wrong place or made a mistake with the wording, please forgive me.)
0_009
Scratcher
1000+ posts

Scratch Workaround Guide VII

is pen down?::pen boolean

pen down
set [pen down v] to [true]

pen up
set [pen down v] to [false]
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

benegam wrote:

mtnif wrote:

can i make a new topic because the owner of this topic went inactive for two months
this comment just makes it sound like they are taking a break. wait more before trying to make a new topic.
No, two months after “I'm taking a break” is a reasonable amount of time to consider the person running the thread—no longer there to run the thread, in my opinion.

First come, first serve. If you need a reference that I'm passing the thread onto you, please comment on our profile (@_nix, comments are reopened now) with a link to your thread. As long as it's not just a stub thread and really is at least the beginnings of a new workaround guide / list of workarounds, we'll say OK, and report your thread to be stickied (that's how things normally go on the forums).

Thanks.

Powered by DjangoBB