Snake v1.0

A plugin for Snake Game, just for fun.



Details

Author
Adrian Statescu
Current version
v1.0
GitHub
thinkphp/snake
Downloads
1469
Category
Widgets
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.3: *

How to use

First you must to include the JS files in the head of your HTML document:

        #HTML
        <script type="text/javascript" src="mootools-core.js"></script>
        <script type="text/javascript" src="snake.js"></script>

In your JS:

       #JS
       window.addEvent('domready',function(){
              new Snake({divId:'snake', 
                         width:15, 
                         height:15, 
                         scoreId: 'score', 
                         timeId:'time', 
                         highScoreId:'high-score', 
                         resetId:'reset-high-score', 
                         speedPrefixId: 'speed-'
                         });
       });  

In your HTML body:

       #HTML
       <div id="container">
           <div id="stats">
                <p id="score-p" class="stat"><span class="stat-title">Score: </span><span id="score">0</span></p>
                <p id="time-p" class="stat"><span class="stat-title">Time: </span><span id="time"></span></p>
          </div>
          <div id="snake"></div>
          <p id="high-score-p">Your high score <span id="high-score"></span> <a href="#" id="reset-high-score">reset</a></p> 
          <div id="logger"></div>
       </div>

In your HEAD document:

       #css  
       <link rel="stylesheet" type="text/css" href="snake.css" />

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus