1

I created the breakout game in jquery with help of a handy tutorial. My professor now tells me it must be in plain javascript and I am having trouble converting to plain javascript.

The fiddle is here: http://jsfiddle.net/Kinetic915/9bLEk/6/

the code loads properly. I am finding a problem changing the code that renders the ball. It works with jquery here:

Cir = $('#canvas')[0].getContext("2d");

Cir.beginPath();
Cir.arc(x, y, 10, 0, Math.PI * 2, true);
Cir.closePath();
Cir.fill();

The lower works by itself in a separate fiddle, but NOT inside of the project.

var canvas = document.getElementById("canvas");
var Cir = canvas.getContext("2d");

Cir.beginPath();
Cir.arc(x, y, 10, 0, Math.PI * 2, true);
Cir.closePath();
Cir.fill();

Any help appreciated!

Turnip
  • 33,774
  • 14
  • 81
  • 102
user2138152
  • 121
  • 3
  • 10

0 Answers0