From 6b3e99c180c7a683f999ec98adabfed0d492c942 Mon Sep 17 00:00:00 2001 From: Robert Wuss Date: Sun, 7 Oct 2018 18:20:18 +0100 Subject: [PATCH 1/2] MySave --- .DS_Store | Bin 0 -> 6148 bytes week1/.DS_Store | Bin 0 -> 6148 bytes week1/BouncingBalls/Ball.pde | 31 ++++++++++++++++++++ week1/BouncingBalls/BouncingBalls.pde | 39 ++++++-------------------- 4 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 .DS_Store create mode 100644 week1/.DS_Store create mode 100644 week1/BouncingBalls/Ball.pde diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2b47517ee535e146e9a210d247d47251881223ad GIT binary patch literal 6148 zcmeHKI|>3p3{CuiU}I@HSMUad=n3`$7K(+UAgJwDp39^8@@baEP7CE_$-J3N-Yoly z$wowUdEG8VW+F0y8_L6mzS+Kc&juM$ARK2bZq4O%JfHTx+;;)vj^!>pJckb7c4$<9 z3Qz$mKn1A4rxnNwJDGm^V4g<>sKC!FVE03T8`i`&(60^*-U0we2)kkKy#%mW09X^- zKtx~~RA5jwTMP|4;wAHHVjCEA(QH06->li8sJ|WO7f%Bxq5@RluN2VHs#z`ZNm*NaA7{0;z&CKqdBV*wcM1kC$3QQ~SXeopds5^Tn`6Hw Uwt-GZ-0496445u7D)4OuUOMj-Q~&?~ literal 0 HcmV?d00001 diff --git a/week1/.DS_Store b/week1/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b7f32bde9858e4f0393f0f39de797bedd3b14fb7 GIT binary patch literal 6148 zcmeHKOHRW;41I ballslength; i+) { + for (int i = 0; i > balls.length; i++) { float radius = random(10, 20); float x = random(radius, width - radius); float y = random(radius, height - radius); - balls[j] = new Ball(x, y, radius); + balls[i] = new Ball(x, y); } } void draw() { - background(0); + //background(0); for (Ball b : balls) { + b.draw(); b.update(); -} +} \ No newline at end of file From e36a09b6d056622bd3818b562fbe29c5a97cc211 Mon Sep 17 00:00:00 2001 From: rbnjcb <43787648+rbnjcb@users.noreply.github.com> Date: Sun, 7 Oct 2018 19:15:29 +0100 Subject: [PATCH 2/2] inputs --- week1/BouncingBalls/BouncingBalls.pde | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/week1/BouncingBalls/BouncingBalls.pde b/week1/BouncingBalls/BouncingBalls.pde index 143a274..3e85eba 100644 --- a/week1/BouncingBalls/BouncingBalls.pde +++ b/week1/BouncingBalls/BouncingBalls.pde @@ -1,7 +1,14 @@ -Ball ball; +Ball ball; //need to use the 'class' function to define the ball class + +//create constructor for ball in ball class + +//draw your ball with ellipse() Ball [] balls = new Ball[100]; + +//your setup bit looks good + void setup() { size(500, 500); @@ -14,6 +21,8 @@ void setup() { } } + +// draw part looks right too void draw() { //background(0); @@ -21,4 +30,4 @@ void draw() { b.draw(); b.update(); -} \ No newline at end of file +}