+ 5
p5 Button Interaction
Why doesn't the ellipse appear when I click the button? https://code.sololearn.com/WtbZv7193MZF/?ref=app
4 odpowiedzi
+ 8
( ͡⚆ ͜ʖ ͡⚆)
Since you are using an object constructor (Ball()), in the add() you have to create an instance of Ball by using the new keyword ex. let ball = new Ball().
There were two other problems I notice
1. random(0.400) should be random(0,400)
2. don't need the draw function in this case
https://code.sololearn.com/WTW4Zk013SS2/#html
+ 7
Thanks, I was told using objects is a better choice, is that true? Anyway thanks for the help!
+ 7
That is true if you want the object to interact with other objects, its environment, or user interaction.
- 1
Good day peeps good to be here