0
The red circle in the game development with JS I can't get past it
7 Respostas
+ 3
try this :
window.onload = function() {
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
function fCircle(x, y, radius, color) {
context.fillStyle = color;
context.arc(x, y, radius, 0, 2 * Math.PI);
context.fill();
}
fCircle(300, 350, 50, 'red');}
+ 1
Should I post the error message or the whole code
+ 1
Thanks it worked
0
Not that i could help you, but it is probably worth it going a bit more into detail what exactly you have a problem with and especially what you already tried so far
0
Depends how long the code is, but if you save it in code pkayground and insert the link here probably the whole code should work…
0
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
var x = 300;
var y = 350;
context.arc(x, y, 50, 0, 2 * Math.PI);
context.fillStyle="red";
context.fill();
0
So uncaught type Error in the get context line