Why aren’t the ball objects appearing on the screen? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why aren’t the ball objects appearing on the screen?

https://code.sololearn.com/WEE5bJCAUhow/?ref=app I’m creating objects with a constructor/class and manipulating them with prototype functions. I’ve created my ball objects and called them on the prototype but they do not appear on screen and I can’t seem to figure out why yet. This has me stumped for now. If anyone has any insight or a solution, that would be very much appreciated

28th Jan 2019, 12:42 AM
Thomas Czernek
Thomas Czernek - avatar
1 Answer
+ 4
Thomas In the Ball class constructor this.ballXPos = this.ballXPos; this.ballYPos = this.ballYPos; It getting XPos and YPos passed to it. this.ballXPos = ballXPos; this.ballYPos = ballYPos; You also need to check your draw function because you also have a color problem.
28th Jan 2019, 1:14 AM
ODLNT
ODLNT - avatar