Malisa Huzaifa - Web Multimedia HTML6 Canvas & SVG

72 window.onload=(function() { myGameArea.start(); btnAnimasi.addEventListener("click",function(){ myGamePiece = new component(40, 40, "black", 40, 150); }); }); var myGameArea = { canvas : document.createElement("canvas"), start : function() { this.canvas.width = 300; this.canvas.height = 300; this.context = this.canvas.getContext("2d"); document.body.insertBefore(this.canvas, document.body.childNodes[0]); this.interval = setInterval(updateGameArea, 10); }, stop : function() { clearInterval(this.interval); }, clear : function() { this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); }

RkJQdWJsaXNoZXIy MTM3NDc5MQ==