diff options
Diffstat (limited to 'resources/js/scene.js')
-rw-r--r-- | resources/js/scene.js | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/resources/js/scene.js b/resources/js/scene.js index 7e7e895..d035827 100644 --- a/resources/js/scene.js +++ b/resources/js/scene.js @@ -1,5 +1,9 @@ class Scene { + // boid radius + // no of boids + // scene width + // scene height constructor(component_size, no_of_components) { this.component_size = component_size; this.no_of_components = no_of_components; @@ -13,25 +17,26 @@ class Scene { initComponents() { let components = []; for (let i = 0; i < this.no_of_components; i++) { - let x, y, z; - if (i == 0) { - x = 100; - y = 100; - z = 0; - } else { - x = 105; - y = 100; - z = 180; - } + // let x, y, z; + // if (i == 0) { + // x = 100; + // y = 100; + // z = 0; + // } else { + // x = 105; + // y = 100; + // z = 180; + // } - components.push(new Component( + components.push(new Boid( this.gameArea.context, this.component_size, "black", + 300, 300, Math.random() * 360, // x, y, z, - Math.random() * (this.gameArea.canvas.width - 100) + 50, - Math.random() * (this.gameArea.canvas.height - 100) + 50, - Math.random() * 360, + // Math.random() * (this.gameArea.canvas.width - 100) + 50, + // Math.random() * (this.gameArea.canvas.height - 100) + 50, + // Math.random() * 360, i )); } |