Ask coding questions

← Back to all posts
Error
WilliamXing (43)

What is the error? It doesn't work.

Comments
hotnewtop
Coder100 (16985)

You are currently calling the class not the instance.
You need to call the instance as it is not a static method.

      ball.draw();
      ball.move();

please, add semicolons!!

WilliamXing (43)

I used Ball.draw() and Ball.move() @Coder100

Coder100 (16985)

Ball is a class, you did not define any static methods for that class, so you can't do that. @WilliamXing

WilliamXing (43)

It says ball is not defined @Coder100

Coder100 (16985)

you defined ball inside a method lol @WilliamXing

WilliamXing (43)

How to make it bounce? @Coder100

EpicGamer007 (1609)

You dont have a Ball.draw function