File tree 5 files changed +48
-9
lines changed
5 files changed +48
-9
lines changed Original file line number Diff line number Diff line change 10
10
11
11
<!-- CDNs -->
12
12
< script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.bundle.min.js "
integrity ="
sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz "
crossorigin ="
anonymous "
> </ script >
13
+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.js "> </ script >
14
+
13
15
< link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/css/bootstrap.min.css "
rel ="
stylesheet "
>
16
+ < link href ="/SimulationLabs/Stylesheets/Default.css " rel ="stylesheet ">
14
17
</ head >
15
18
16
19
< body >
17
20
{% include HeaderBar.html %}
18
- < div id ="headerBar "> </ div >
19
21
20
22
<!-- Page content -->
21
23
< p > This is the boids page </ p >
24
+
25
+ < h1 > What you'll create </ h1 >
26
+
27
+ < script src ="/Scripts/Boids/Boids.js "> </ script >
22
28
</ body >
23
29
</ html >
Original file line number Diff line number Diff line change
1
+ var x = 200 ;
2
+ var y = 200 ;
3
+
4
+ function addRandomDirection ( ) {
5
+ let randomChoice = floor ( random ( 4 ) ) ;
6
+
7
+ switch ( randomChoice ) {
8
+ case 0 :
9
+ x ++ ;
10
+ break ;
11
+ case 1 :
12
+ x -- ;
13
+ break ;
14
+ case 2 :
15
+ y ++ ;
16
+ break ;
17
+ default :
18
+ y -- ;
19
+ }
20
+ }
21
+
22
+ function setup ( ) {
23
+ createCanvas ( 400 , 400 ) ;
24
+ background ( 140 , 205 , 230 ) ;
25
+ }
26
+
27
+ function draw ( ) {
28
+ stroke ( 245 , 175 , 0 ) ; // pen colour
29
+ addRandomDirection ( ) ; // change state
30
+ point ( x , y ) ; // draw state
31
+ }
Original file line number Diff line number Diff line change 1
1
.headerStyle {
2
- background-color : red;
3
- }
2
+
3
+ }
Original file line number Diff line number Diff line change 1
- < nav class ="navbar navbar-expand-lg navbar-light bg-light headerStyle ">
1
+ <!-- Header Bar component! -->
2
+ < nav class ="navbar navbar-expand-lg navbar-light bg-light headerStyle " id ="headerStyle ">
2
3
< div class ="container-fluid ">
3
4
< a class ="navbar-brand " href ="/SimulationLabs/ "> Simulation Labs </ a >
4
5
<!-- This collapsible element is needed for the items to align from the left -->
8
9
< a class ="nav-link dropdown-toggle " href ="# " id ="navbarDropdownToggle " role ="button " data-bs-toggle ="dropdown "> Labs </ a >
9
10
< ul class ="dropdown-menu ">
10
11
< li >
11
- < a class ="dropdown-item " href ="/SimulationLabs/Pages/ Boids ">
12
+ < a class ="dropdown-item " href ="/SimulationLabs/Boids ">
12
13
Lab 1 - Boids
13
14
</ a >
14
15
</ li >
15
16
< li >
16
- < a class ="dropdown-item " href ="/SimulationLabs/Pages/ Boids ">
17
+ < a class ="dropdown-item " href ="/SimulationLabs/Boids ">
17
18
Lab 2 - Noise
18
19
</ a >
19
20
</ li >
22
23
</ ul >
23
24
</ div >
24
25
</ div >
25
- </ nav >
26
+ </ nav >
Original file line number Diff line number Diff line change 12
12
<!-- CDNs -->
13
13
< script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.bundle.min.js "
integrity ="
sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz "
crossorigin ="
anonymous "
> </ script >
14
14
< link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/css/bootstrap.min.css "
rel ="
stylesheet "
>
15
+ < link href ="/SimulationLabs/Stylesheets/Default.css " rel ="stylesheet ">
15
16
</ head >
16
17
17
- < body >
18
+ < body >
18
19
{% include HeaderBar.html %}
19
20
<!-- Page content -->
20
- < p > Testing testing123 </ p >
21
+ < p > </ p >
21
22
22
23
</ body >
23
24
</ html >
You can’t perform that action at this time.
0 commit comments