When I copied your code, the JS++ compiler gave me this error:
"if (typeof (canvas.getContext) !== undefined) {"
"[ ERROR ] JSPPE5000: Cannot convert void' tostring' at line 44 char 35 at main.jspp"
I think you meant to use the string "undefined" instead of the undefined value. After I fixed this, it worked and I get a red bouncing ball. You should really consider using JS++ to catch errors like this.
When I copied your code, the JS++ compiler gave me this error:
"if (typeof (canvas.getContext) !== undefined) {"
"[ ERROR ] JSPPE5000: Cannot convert
void' to
string' at line 44 char 35 at main.jspp"I think you meant to use the string "undefined" instead of the undefined value. After I fixed this, it worked and I get a red bouncing ball. You should really consider using JS++ to catch errors like this.