Snake - the game: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 7: Line 7:
<script type="text/javascript">
<script type="text/javascript">
/* <![CDATA[ */
/* <![CDATA[ */
     var board = JXG.JSXGraph.initBoard('box',{originX:0,originY:600,unitX:30,unitY:30,axis:true,grid:true});
     var board = JXG.JSXGraph.initBoard('box',{originX:0,originY:600,unitX:30,unitY:30,grid:true});
     var snake = {
     var snake = {
         points : [[10,11],[10,10]],
         points : [[10,11],[10,10]],
Line 48: Line 48:
         else if (code==40) { snake.dir = [0,-1]; }
         else if (code==40) { snake.dir = [0,-1]; }
     }
     }
     document.getElementById('box').onkeydown = keyDown;
     document.onkeydown = keyDown;


     var crawl = function() {
     var crawl = function() {

Revision as of 14:00, 8 February 2009