game development with javascript question | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

game development with javascript question

both of these seem to be identical but the one on the top doesn't produce a red circle like the one on the bottom does and I cant seam to figure out why. The bottom code was copy and pasted from the code repo and the one on top I typed out myself. 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(); 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();

8th Dec 2022, 2:30 PM
Aric Snyder
Aric Snyder - avatar
3 Respuestas
+ 4
Syntax error: fillstyle on the first one
8th Dec 2022, 2:37 PM
Calviղ
Calviղ - avatar
0
Wow thank you!
8th Dec 2022, 2:39 PM
Aric Snyder
Aric Snyder - avatar
0
PI is typed as Pi in the top one
10th Dec 2022, 3:02 AM
Space Turtle
Space Turtle - avatar