A Pen by janzeteachesit on CodePen.
Last active
February 18, 2017 03:10
-
-
Save janzeteachesit/bfa7add8d6dcbe02399951ff996422de to your computer and use it in GitHub Desktop.
Chapter 1: Tennis_Step03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
As long as it's between the start and end marks then it's a valid comment and won't show up on the page. But people can View Source in their browser and see it! | |
--> | |
<canvas id="gameCanvas" width="1200" height="900"></canvas><!-- //// --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Utilising CodePen JavaScript Console (//codepen.io/nullobject/pen/cngzI) | |
made with love by @nullobject (http://joshbassett.info), 2014. | |
Stuff from tutorial not needed in CodePen | |
<!DOCTYPE>, <html>, <head> <body> tags | |
window.onload = function script | |
grist for this pen: | |
*/ | |
// console.log("Hello, World!"); | |
// console.log("Here's another line of text going to the JavaScript console"); | |
// console.log("Jimmy Joe Bob!"); example of commenting out. | |
// console.log("PROGRAMMING RULES OMB WHEEEEEEE!!1!!1!ONE"); | |
/*Here's how a multi-line comment looks in JavaScript. Just like the HTML one it won't be used by the browser, but is still visible when someone does a View Source.*/ | |
/* | |
////; a signal that this needs to/will be changed later. | |
*/ | |
var canvas; //// | |
var canvasContext; //// | |
canvas = document.getElementById('gameCanvas'); //// | |
canvasContext = canvas.getContext('2d'); //// | |
drawEverything(); //// | |
function drawEverything() { //// | |
// clear the game view by filling it with black | |
canvasContext.fillStyle = '#222'; //// | |
canvasContext.fillRect(0, 0, canvas.width, canvas.height); //// | |
// draw a white circle | |
canvasContext.fillStyle = '#fff'; //// | |
canvasContext.beginPath(); //// | |
canvasContext.arc(75, 75, 10, 0, Math.PI*2, true); //// | |
canvasContext.fill(); //// | |
} //// | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//codepen.io/nullobject/pen/cngzI"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="//codepen.io/nullobject/pen/cngzI" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment