Tetris: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Even Tetris can be implemented with JSXGraph.
<html>
<html>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
         <style type="text/css">
         <style type="text/css">
           .jxgbox {
           .jxgbox {
Line 12: Line 10:
           body {
           body {
             font-family:Arial;
             font-family:Arial;
          }
          div {
            float:left;
margin-top:10px;
margin-right:50px;
           }
           }
         </style>  
         </style>  
 
<script type="text/javascript" src="https://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
   <script type="text/javascript">
   <script type="text/javascript">
    /* <![CDATA[ */
     var started = false;
     var started = false;
     var board = JXG.JSXGraph.initBoard('jxgbox', {originX: 0, originY: 500, unitX: 25, unitY: 25, showCopyright:false, showNavigation:false}); // Spielfeld 10x20
     var board = JXG.JSXGraph.initBoard('jxgbox', {originX: 0, originY: 500, unitX: 25, unitY: 25, showCopyright:false, showNavigation:false});
     var board2 = JXG.JSXGraph.initBoard('jxgbox2', {originX: 0, originY: 125, unitX: 25, unitY: 25, showCopyright:false, showNavigation:false});
     var board2 = JXG.JSXGraph.initBoard('jxgbox2', {originX: 0, originY: 125, unitX: 25, unitY: 25, showCopyright:false, showNavigation:false});
     var usedPolys = new Array(10);
     var usedPolys = new Array(10);
Line 386: Line 389:
      
      
     function startTetris() {
     function startTetris() {
document.getElementById('jxgbox').focus();
         if(!started) {
         if(!started) {
             started = true;
             started = true;
Line 397: Line 401:
         }
         }
     }
     }
  /* ]]> */
   </script>
   </script>
</html>
</html>

Latest revision as of 11:06, 17 March 2020