Problems getting Canvas Tag working-SOLVED
I am working my way through the intro to game making. My outputs do NOT look like the example, but as far as I can tell, I have no errors in my code. Running on Android. The code: <html> Â Â Â <h1 align="center">My Jumper Game</h1> Â Â Â <p align="center">A fun flappy-bird like game.</p> Â Â Â <canvas id="canvas", width=600Â height=400>Your Browser does not support the HTML 5 Canvas Tag</canvas> Â Â Â <br></br> Â Â Â <button id="jump">Jump</button> </html> CSS body{ Â Â Â background-color:#c3c3c3; } h1{ Â Â Â color:#4c6ebb; #canvas { Â Â Â width:100%; Â Â Â background-color:#000000; } JAVASCRIPT window.onload=function(){ Â Â Â let btn=document.getElementById("jump"); Â Â Â let count=0 Â Â Â btn.onclick=function(){ Â Â Â Â Â Â Â count+=1; Â Â Â Â Â Â Â console.log(count); Â Â Â } } window.onload=function(){ var canvas=document.getElementById("canvas"); var context=canvas.getContext("2d"); var x=300; var y=350; context.arc(x,y,50,2*Math.PI,true); context.fillStyle="red"; context.fill(); } Not sure what I'm doing wrong, but all I get is sm