43 lines
1.1 KiB
HTML
43 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf8">
|
|
<title>example scratchblocks page</title>
|
|
|
|
<!-- Include jQuery -->
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
|
|
|
<!-- Include scratchblocks files -->
|
|
<link rel="stylesheet" href="//scratchblocks.github.io/scratchblocks2.css">
|
|
<script src="//scratchblocks.github.io/scratchblocks2.js"></script>
|
|
|
|
<!-- Parse blocks -->
|
|
<script>
|
|
$(document).ready(function() {
|
|
scratchblocks2.parse();
|
|
});
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<h1>scratchblocks example</h1>
|
|
|
|
<p>Example static usage of <a href="http://github.com/tjvr/scratchblocks">scratchblocks</a>.</p>
|
|
|
|
<!-- Example script -->
|
|
<pre class="blocks">
|
|
define dance (speed)
|
|
set [dist v] to ((speed) * (distance to [mouse-pointer v]))
|
|
repeat until ((timer) > [10])
|
|
move (dist) steps
|
|
wait (1) secs // Pause for a moment
|
|
move (() - (dist)) steps
|
|
play note (42 v) for (0.5) beats
|
|
if <mouse down?>
|
|
say [Whoops!]
|
|
end
|
|
end
|
|
</pre>
|
|
|
|
</body>
|
|
</html>
|