Tetris: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Even Tetris can be implemented with JSXGraph.
<html>
<html>
 
        <style type="text/css">
          .jxgbox {
            overflow:hidden;
            background-color:#ffffff;
            border-style:solid;
            border-width:2px;
            border-color:#000000;
          }
          body {
            font-family:Arial;
          }
          div {
            float:left;
margin-top:10px;
margin-right:50px;
          }
        </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 373: Line 389:
      
      
     function startTetris() {
     function startTetris() {
document.getElementById('jxgbox').focus();
         if(!started) {
         if(!started) {
             started = true;
             started = true;
Line 384: Line 401:
         }
         }
     }
     }
  /* ]]> */
   </script>
   </script>
</html>
</html>

Latest revision as of 11:06, 17 March 2020