This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
scratchblocks/example.html
tjvr 5f06e5b873 Rename scratchblocks2 -> scratchblocks
because numbers in project names is very, very silly
2016-02-22 13:37:41 +00:00

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) &gt; [10])
move (dist) steps
wait (1) secs // Pause for a moment
move (() - (dist)) steps
play note (42 v) for (0.5) beats
if &lt;mouse down?&gt;
say [Whoops!]
end
end
</pre>
</body>
</html>