From ad515ecb5297f2cf0224ceeba363c17f94afb72d Mon Sep 17 00:00:00 2001 From: Ray Antonius Date: Sat, 20 Oct 2018 11:15:05 +0700 Subject: [PATCH] Add Labels to sliders --- chp06_agents/NOC_6_08_SeparationAndSeek/sketch.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chp06_agents/NOC_6_08_SeparationAndSeek/sketch.js b/chp06_agents/NOC_6_08_SeparationAndSeek/sketch.js index 1c538e85..4d98c91f 100644 --- a/chp06_agents/NOC_6_08_SeparationAndSeek/sketch.js +++ b/chp06_agents/NOC_6_08_SeparationAndSeek/sketch.js @@ -20,9 +20,15 @@ function setup() { vehicles.push(new Vehicle(random(width), random(height))); } - slider1 = createSlider(0, 8, 4); - slider2 = createSlider(0, 8, 4); - slider3 = createSlider(10, 160, 24); + slider1 = createSlider(0, 8, 4); //Separation Force + slider2 = createSlider(0, 8, 4); //Seek Force + slider3 = createSlider(10, 160, 24); //Desired Separation Distance + s1 = createP("Separation Force"); + s2 = createP("Seek Force"); + s3 = createP("Separation Distance"); + s1.position(15, 380); + s2.position(163, 380); + s3.position(267, 380); } @@ -36,4 +42,4 @@ function draw() { v.display(); } -} \ No newline at end of file +}