diff --git a/Boids.html b/Boids.html index dca884c..13d6e36 100644 --- a/Boids.html +++ b/Boids.html @@ -10,84 +10,137 @@ - + - - - + + - + +
{% include HeaderBar.html %} - -This is the boids page
- -This is the boids page
+ +There's probably a bootstrap component for this...
-There's probably a bootstrap component for this...
+We will be coding in JavaScript but don't worry about knowing the ins and outs of the language; you should be able to pick it up as we go!
+We will be coding in JavaScript but don't worry about knowing the ins and outs of the language; you should be able to pick it up as we go!
-To get started, create an account for the web editor.
Open a new sketch (File->New)
Your new sketch should have 2 functions:
+To get started, create an account for the web editor.
Open a new sketch (File->New)
Your new sketch should have 2 functions:
+ +
-
- console.log('hello world');
-
-
+ We create the canvas (arguments being the width and length) in setup() since we only need to do this once, and draw background (which you can call with RGB colour arguments as below) is called every frame in draw()!
-
+
+function draw() {
+ redV = 128
+ greenV = 12
+ blueV = 128
+ background(redV, greenV, blueV); // my favourite colour; purple!
+}
+
+
-
- Applying forces, basic goals
+
+
+function setup() {
+ createCanvas(400, 400);
+ background(222, 222, 222);
+}
- With room for more behaviours!
+let circleSize = 10;
- Extension Material
+function draw() {
+ circle(mouseX, mouseY, circleSize);
+}
+
+
- Link to an extension site with scope for learning how to host your own
+
+
+function setup() {
+ createCanvas(400, 400);
+}
-
- - Dear Game Developers, Stop Messing This Up! - YT Video on delta-time and basic physics
- - Nature of Code - A book by Daniel Shiffman which these labs take inspiration from! It features a section on boids and many more simulations of things from nature (highly recommend)
- - Coding Adventure: Boids - Sebastian Lague's brilliant video on boids is the main inspiration for this lab! He takes boids into 3D and explores a raycasting approach to collision avoidance
-
+let circleSize = 10;
+
+function draw() {
+ background(222, 222, 222); // background drawn every frame!
+ circle(mouseX, mouseY, circleSize);
+}
+
+
+
+ Applying forces, basic goals
+ +With room for more behaviours!
+ +Link to an extension site with scope for learning how to host your own
+ +