Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #3406

Open
wants to merge 133 commits into
base: master
Choose a base branch
from
Open

merge #3406

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
297bf25
google dent
YeesterPlus Aug 17, 2024
d01fe2c
better looks
YeesterPlus Aug 17, 2024
20227c8
fix
YeesterPlus Aug 17, 2024
b5117a5
to block
YeesterPlus Aug 17, 2024
c327c5c
cap all
YeesterPlus Aug 17, 2024
24c0caf
commit
YeesterPlus Aug 17, 2024
8b4f879
commit
YeesterPlus Aug 17, 2024
d0c4101
commit
YeesterPlus Aug 17, 2024
a5bcafb
commit
YeesterPlus Aug 17, 2024
73b796f
commit
YeesterPlus Aug 17, 2024
ad6bead
commit
YeesterPlus Aug 17, 2024
f066970
commit
YeesterPlus Aug 17, 2024
307b328
commit
YeesterPlus Aug 17, 2024
33afbf3
commit
YeesterPlus Aug 17, 2024
3d9b133
allow bottom blocks
YeesterPlus Aug 17, 2024
26e72d5
updrade foreverloop
YeesterPlus Aug 17, 2024
ae66f78
fix
YeesterPlus Aug 17, 2024
d16d134
fix again
YeesterPlus Aug 17, 2024
61c05f1
fix forevr
YeesterPlus Aug 17, 2024
d80da73
fix
YeesterPlus Aug 17, 2024
63f6d23
test
YeesterPlus Aug 17, 2024
b00b63e
jr forever
YeesterPlus Aug 17, 2024
4f85d3e
fix
YeesterPlus Aug 17, 2024
d360b7b
fix
YeesterPlus Aug 17, 2024
98f3309
fix
YeesterPlus Aug 17, 2024
692a301
fix
YeesterPlus Aug 17, 2024
3eb66da
fix
YeesterPlus Aug 17, 2024
8f28815
nice
YeesterPlus Aug 18, 2024
4870acd
perfect forever
YeesterPlus Aug 18, 2024
40b063d
fix code cleaness
YeesterPlus Aug 18, 2024
660e4a0
remove forever from list for convienence
YeesterPlus Aug 19, 2024
735e2bb
add blocks
YeesterPlus Aug 19, 2024
a8c18f3
fix
YeesterPlus Aug 19, 2024
7075d38
fix
YeesterPlus Aug 19, 2024
ad13f81
fix
YeesterPlus Aug 20, 2024
ae61d50
fix
YeesterPlus Aug 20, 2024
494c52c
Merge branch 'jmoenig:master' into master
YeesterPlus Aug 20, 2024
a14889c
fix
YeesterPlus Aug 20, 2024
84450c0
fix promises
YeesterPlus Aug 20, 2024
7d07c63
fix
YeesterPlus Aug 20, 2024
bfab6b0
fix
YeesterPlus Aug 20, 2024
6a89ae4
fix
YeesterPlus Aug 20, 2024
923639d
fix
YeesterPlus Aug 20, 2024
da18813
fix
YeesterPlus Aug 20, 2024
e06f7e6
fix existing error blocks
YeesterPlus Aug 20, 2024
562b900
add new blocks
YeesterPlus Aug 20, 2024
29dea9e
fix
YeesterPlus Aug 20, 2024
5c9b02b
fix
YeesterPlus Aug 20, 2024
62d01c0
fix
YeesterPlus Aug 20, 2024
1230345
fix
YeesterPlus Aug 20, 2024
b2f239e
fix
YeesterPlus Aug 20, 2024
e0fa502
fix
YeesterPlus Aug 20, 2024
3b6052d
good look
YeesterPlus Aug 20, 2024
a3b86ef
more transparent
YeesterPlus Aug 20, 2024
9e8a666
fix
YeesterPlus Aug 20, 2024
450b28e
fix
YeesterPlus Aug 20, 2024
983905f
fix
YeesterPlus Aug 20, 2024
ebd5a95
fix
YeesterPlus Aug 20, 2024
bbd88f5
fix bool
YeesterPlus Aug 20, 2024
c4b4ce9
fix
YeesterPlus Aug 20, 2024
3bf1e70
fix
YeesterPlus Aug 20, 2024
cbb4216
fix
YeesterPlus Aug 20, 2024
da3c283
fix
YeesterPlus Aug 20, 2024
dc4683b
fix
YeesterPlus Aug 20, 2024
4753bfd
fix
YeesterPlus Aug 20, 2024
814897c
fix
YeesterPlus Aug 20, 2024
422cbc4
fix
YeesterPlus Aug 20, 2024
6c87122
fix outline glitch(visual)
YeesterPlus Aug 20, 2024
b49fc83
fix
YeesterPlus Aug 21, 2024
e685436
looks
YeesterPlus Aug 21, 2024
8a6b8ee
top
YeesterPlus Aug 21, 2024
69d382d
fix
YeesterPlus Aug 21, 2024
ad757d7
fix
YeesterPlus Aug 21, 2024
7852cca
fix
YeesterPlus Aug 21, 2024
9883200
fix
YeesterPlus Aug 21, 2024
305b9ed
fix
YeesterPlus Aug 21, 2024
da9db98
commit
YeesterPlus Aug 21, 2024
a070b2c
commit
YeesterPlus Aug 21, 2024
f00095a
commit
YeesterPlus Aug 21, 2024
135af65
commit
YeesterPlus Aug 21, 2024
29eaf82
commit
YeesterPlus Aug 21, 2024
02f0959
commit
YeesterPlus Aug 21, 2024
df1684a
commit
YeesterPlus Aug 21, 2024
41cff2f
commit
YeesterPlus Aug 21, 2024
d189952
commit
YeesterPlus Aug 21, 2024
fac8e9f
commit
YeesterPlus Aug 21, 2024
de66146
commit
YeesterPlus Aug 21, 2024
b74816a
commit
YeesterPlus Aug 21, 2024
db4334b
commit
YeesterPlus Aug 21, 2024
d77680d
commit
YeesterPlus Aug 21, 2024
02caef5
commit
YeesterPlus Aug 21, 2024
294fd2a
commit
YeesterPlus Aug 21, 2024
cc67d80
commit
YeesterPlus Aug 21, 2024
dd99411
commit
YeesterPlus Aug 22, 2024
7136c57
commit
YeesterPlus Aug 22, 2024
cc90b54
commit
YeesterPlus Aug 22, 2024
791f598
commit
YeesterPlus Aug 22, 2024
fdf450c
commit
YeesterPlus Aug 22, 2024
46fb2b8
commit
YeesterPlus Aug 22, 2024
144ebef
commit
YeesterPlus Aug 22, 2024
2b3bb56
commit
YeesterPlus Aug 22, 2024
33f577e
commit
YeesterPlus Aug 22, 2024
68c66e6
commit
YeesterPlus Aug 22, 2024
d6750c2
commit
YeesterPlus Aug 22, 2024
8cbaf80
commit
YeesterPlus Aug 22, 2024
58d820f
commit
YeesterPlus Aug 22, 2024
a3725e4
commit
YeesterPlus Aug 22, 2024
c946f75
commit
YeesterPlus Aug 22, 2024
42c70cc
commit
YeesterPlus Aug 22, 2024
65549be
commit
YeesterPlus Aug 22, 2024
7021107
commit
YeesterPlus Aug 22, 2024
9e97d9c
commit
YeesterPlus Aug 23, 2024
ea0bbb4
commit
YeesterPlus Aug 23, 2024
ad5aef8
commit
YeesterPlus Aug 23, 2024
5205734
commit
YeesterPlus Aug 23, 2024
2cfbe9c
commit
YeesterPlus Aug 23, 2024
f7d62e0
commit
YeesterPlus Aug 23, 2024
3cbb27f
commit
YeesterPlus Aug 23, 2024
4caa269
commit
YeesterPlus Aug 23, 2024
e32f07a
commit
YeesterPlus Aug 23, 2024
bbfe03a
commit
YeesterPlus Aug 23, 2024
fb90c5a
commit
YeesterPlus Sep 7, 2024
321867e
commit
YeesterPlus Sep 7, 2024
14b0601
commit
YeesterPlus Sep 7, 2024
2339e71
commit
YeesterPlus Sep 7, 2024
59a31a3
commit
YeesterPlus Sep 7, 2024
b78b79e
commit
YeesterPlus Sep 7, 2024
5f38fab
commit
YeesterPlus Sep 7, 2024
281afec
commit
YeesterPlus Sep 7, 2024
8ce648c
commit
YeesterPlus Sep 7, 2024
0408e76
commit
YeesterPlus Oct 30, 2024
5dfbb4a
commit
YeesterPlus Oct 30, 2024
b274289
commit
YeesterPlus Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/try-catch.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<blocks app="Snap! 7, https://snap.berkeley.edu" version="2"><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="control"><comment w="276" collapsed="false">Catch errors.&#xD;&#xD;Runs the first script. If it succeeds, nothing else happens.&#xD;But if it has an error (something that would otherwise result&#xD;in a red halo around the block), then the second script is run,&#xD;with the text of the error message that would have been shown in the variable ERROR.</comment><header></header><code></code><translations>pt:tenta executar _ e, em caso de erro _ , executa _&#xD;ca:prova de forma segura _ i si _ _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block var="action"/><block var="handler"/><block var="error"/></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block></script></block-definition><block-definition s="error %&apos;msg&apos;" type="command" category="control"><comment x="0" y="0" w="268.6666666666667" collapsed="false">Throw an error.&#xD;&#xD;Makes a red halo appear around the script that runs it,&#xD;with the input text shown in a speech balloon next to&#xD;the script, just like any Snap! error.&#xD;&#xD;This is useful to put in the second script of SAFELY TRY&#xD;after some other instructions to undo the partial work of&#xD;the first script.</comment><header></header><code></code><translations>pt:lança o erro _&#xD;</translations><inputs><input type="%txt"></input></inputs><script><block s="doApplyExtension"><l>err_error(msg)</l><list><block var="msg"/></list></block></script></block-definition><block-definition s="safely try reporting %&apos;this&apos; then if %&apos;error&apos; report %&apos;that&apos;" type="reporter" category="control"><comment w="316.6666666666667" collapsed="false">Catch errors in a reporter.&#xD;&#xD;Evaluates its first input. If that expression successfully reports a value, this block reports that value. If the expression causes a Snap! error,&#xD;then the final input slot is evaluated with the text of what would have&#xD;been the error message in variable ERROR. SAFELY TRY then reports the value of that final expression.&#xD;&#xD;Sometimes you&apos;ll want to throw an error in the final expression. You&#xD;can put an ERROR block inside a CALL block to do that.</comment><header></header><code></code><translations>ca:prova de forma segura reportant _ i si _ reportant _&#xD;</translations><inputs><input type="%anyUE"></input><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doDeclareVariables"><list><l>value</l></list></block><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doSetVar"><l>value</l><block s="evaluate"><block var="this"/><list></list></block></block></script><l>err</l><script><block s="doSetVar"><l>error</l><block var="err"/></block><block s="doSetVar"><l>value</l><block s="evaluate"><block var="that"/><list></list></block></block></script></custom-block><block s="doReport"><block var="value"/></block></script></block-definition></blocks>
<blocks app="Snap! 10, https://snap.berkeley.edu" version="2"><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="control"><comment x="0" y="0" w="276" collapsed="false">Catch errors.&#xD;&#xD;Runs the first script. If it succeeds, nothing else happens.&#xD;But if it has an error (something that would otherwise result&#xD;in a red halo around the block), then the second script is run,&#xD;with the text of the error message that would have been shown in the variable ERROR.</comment><header></header><code></code><translations>pt:tenta executar _ e, em caso de erro _ , executa _&#xD;ca:prova de forma segura _ i si _ _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block var="action"/><block var="handler"/><block var="error"/></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block></script></block-definition><block-definition s="safely try reporting %&apos;this&apos; then if %&apos;error&apos; report %&apos;that&apos;" type="reporter" category="control"><comment x="0" y="0" w="316.6666666666667" collapsed="false">Catch errors in a reporter.&#xD;&#xD;Evaluates its first input. If that expression successfully reports a value, this block reports that value. If the expression causes a Snap! error,&#xD;then the final input slot is evaluated with the text of what would have&#xD;been the error message in variable ERROR. SAFELY TRY then reports the value of that final expression.&#xD;&#xD;Sometimes you&apos;ll want to throw an error in the final expression. You&#xD;can put an ERROR block inside a CALL block to do that.</comment><header></header><code></code><translations>ca:prova de forma segura reportant _ i si _ reportant _&#xD;</translations><inputs><input type="%anyUE"></input><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doDeclareVariables"><list><l>value</l></list></block><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doSetVar"><l>value</l><block s="evaluate"><block var="this"/><list></list></block></block></script><l>err</l><script><block s="doSetVar"><l>error</l><block var="err"/></block><block s="doSetVar"><l>value</l><block s="evaluate"><block var="that"/><list></list></block></block></script></custom-block><block s="doReport"><block var="value"/></block></script></block-definition><block-definition s="throw %&apos;msg&apos;" type="command" category="control"><comment w="268.6666666666667" collapsed="false">Throw an error.&#xD;&#xD;Makes a red halo appear around the script that runs it,&#xD;with the input text shown in a speech balloon next to&#xD;the script, just like any Snap! error.&#xD;&#xD;This is useful to put in the second script of SAFELY TRY&#xD;after some other instructions to undo the partial work of&#xD;the first script.</comment><header></header><code></code><translations>pt:lança o erro _&#xD;</translations><inputs><input type="%txt"></input></inputs><script><block s="doApplyExtension"><l>err_error(msg)</l><list><block var="msg"/></list></block></script></block-definition><block-definition s="error %&apos;name&apos; %&apos;message&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s" initial="1">Error</input><input type="%s" initial="1"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>err_new(name,message)</l><list><block var="name"/><block var="message"/></list></block></block></script></block-definition><block-definition s="name %&apos;error&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s" readonly="true" initial="1"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>err_name(err:Error)</l><list><block var="error"/></list></block></block></script></block-definition><block-definition s="message %&apos;error&apos;" type="reporter" category="control"><header></header><code></code><translations></translations><inputs><input type="%s" readonly="true" initial="1"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>err_message(err:Error)</l><list><block var="error"/></list></block></block></script></block-definition></blocks>
6 changes: 2 additions & 4 deletions snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="apple-touch-icon" href="img/snap-icon-152.png">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="white"/>
<meta name="theme-color" content="rgb(20,20,25)"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Snap!">
Expand Down Expand Up @@ -37,6 +37,7 @@
<script src="src/embroider.js?version=2024-05-09"></script>
<script src="src/sha512.js?version=2019-06-27"></script>
<script src="src/FileSaver.min.js?version=2019-06-27"></script>
<script src="src/nativetypes.js"></script>
<script>
var world;
window.onload = function () {
Expand All @@ -45,9 +46,6 @@

loop = (timestamp) => {
requestAnimationFrame(loop);
if (timestamp - lastTime < 1000 / FPS) {
return;
}
world.doOneCycle();
lastTime = Math.max(
lastTime + 1000 / FPS,
Expand Down
Loading