html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!-- Created by Bell, acceleration -->
<!--Movers as in Nature of Code by Daniel Shiffman-->
<!--Credit to SR for his code on double pendulum from which I got a template-->
<canvas id="cvs"></canvas>
<head> </head>
<canvas id="cvs"></canvas>
<script>
/*
Mover class has
Constructor
Properties position, velocity, acceleration, mass
Behavior move in function update
be seen in function display
what to do at edges (bounce or wrap)
useful external functions are
distance calculator dist
random float or integer generator pick
*/
let ctx,
p = [],
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
body {
margin: 0;
position: fixed;
user-select: none;
-webkit-user-select : none;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run