# Adding features to our bouncing ball demo

**URL:** <https://discourse.mozilla.org/t/adding-features-to-our-bouncing-ball-demo/63369>\
**Category:** Learn\
**Created:** [July 7, 2020, 7:05pm UTC](https://discourse.mozilla.org/t/adding-features-to-our-bouncing-ball-demo/63369 "2020-07-07T19:05:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared\_Cave](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Jared\_Cave](https://discourse.mozilla.org/u/Jared_Cave)\
**Post date:** [July 7, 2020, 7:05pm UTC](https://discourse.mozilla.org/t/adding-features-to-our-bouncing-ball-demo/63369/1 "2020-07-07T19:05:04Z")

</div>

Hi guys,

I’m struggling to understand the bouncing balls assessment. I don’t understand what I need to do in response to the passage below.

 ![image](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/a/3/a3a36159a38343c799d3eeda08f628da0647fb00.png)

Also, my balls have shrunk and I don’t know why (not something I thought I’d write in this forum).

I’ve provided a link to my code below, any help would be much appreciated.

[Codepen](https://codepen.io/JaredCave/pen/RwrMYYK)

Regards,

Jared

---

<div class="post-metadata">

**Author:** ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)\
**Post date:** [July 8, 2020, 1:06pm UTC](https://discourse.mozilla.org/t/adding-features-to-our-bouncing-ball-demo/63369/2 "2020-07-08T13:06:40Z")

</div>

Hi @Jared_Cave!

This is a really difficult assessment, and looking at your code, you are definitely getting there.

The first thing I did was to comment out the line `firstCircle.setControls();`, as the console was complaining that `setControls` is not a function. So there must be something wrong with your `EvilCircle` constructor.

You should also move the creation of the EvilCircle instance out of the loop - you don’t want one EvilCircle for every ball created.

Also, I’m sorry to see that your balls have shrunk. I was going to suggest some ointment, but instead I investigated your code. if you run `balls[0].size`, it returns `true`, whereas it should return a number. I wonder how that has happened?

Have another look, and see if you can figure this out. Also, feel free to have a peep at our version, if you want to get some more clues: [https://github.com/mdn/learning-area/blob/master/javascript/oojs/assessment/main.js](https://github.com/mdn/learning-area/blob/master/javascript/oojs/assessment/main.js)

---

<div class="post-metadata">

**Author:** ![Jared\_Cave](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Jared\_Cave](https://discourse.mozilla.org/u/Jared_Cave)\
**Post date:** [July 9, 2020, 6:08pm UTC](https://discourse.mozilla.org/t/adding-features-to-our-bouncing-ball-demo/63369/3 "2020-07-09T18:08:03Z")

</div>

Hi Chris,

Thanks for the pointers. I realised I skipped the JSON assessment by mistake so I’m going to complete that first then come back to this tomorrow/Saturday. I’ll let you know how is goes.

Regards,

Jared
