MiX1.TK
Site menu
Login form
Section categories
Web Development [20]
Learn about PHP & Web Development
Education [4]
Learn for Free
Knowledge & Tricks [0]
General Knowledge,computer Knowledge & tricks
Writing World [2]
A MiX World of SmS on Various Topics
Search
Main » 2012 » November » 6 » Play A Snake Game
9:56 PM
Play A Snake Game









first of all download some require files from our cloud storage from following link

DownLoad Requirements

now extract these files in your project's root node

now make a index.html file in that root directory of your project ,parallel to the extracted folders

now open index.html and paste the following code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>jQuery Snake</title>
    <link rel="stylesheet" type="text/css" media="screen" href="css/jq.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="css/tabs.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="css/snake.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
    <!--<script type="text/javascript" src="/js/jquery.js"></script>-->
    <script type="text/javascript" src="js/jquery.snake.js"></script>
    <script type="text/javascript">
        $(function(){
            // FF2/Mac Opacity Bug
            ($.browser.mozilla && parseFloat($.browser.version) < 1.9 && navigator.appVersion.indexOf('Mac') !== -1) && $('body').css('-moz-opacity',.999);
           
            // setup the game
            Snake.setup();
           
            $("a#start-game").click(function(e){
                e.preventDefault();
                // start the game
                Snake.newGame();
            });
           
            $("a#bugs-exp").click(function(){
                $(".bugs").slideToggle();
            });
            $("a#source-exp").click(function(){
                $(".source").slideToggle();
            });
        });
    </script>   
</head>
<body>
       
    <div id="main">
   
                <div id="overview" class="tabContent">       
       
            <div id="snake-col-info">

                <div id="marginLeft">
       
                <h2>Instructions</h2>
                <p>
                    Use the keyboard arrow keys to control the snake. Eat red cherrires without touching the brics walls. speed will increase every eat of cherry and game level will also increase after eating all cherries of current level. Have fun!           
                </p>
               
                <h2>Shortcut Keys</h2>
                <ul>
                    <li>P : Pause/Resume Game</li>
                    <li>N : New Game</li>
                    <li>G : Toggle Grid</li>           
                </ul>
               
            <p>Test on FF2; FF3; Opera 9.52; IE6</p>

                </div>
            </div>       
           
            <div id="snake-col-map">
       
                <noscript class="error">
                    You need javascript enabled on your browser to be able to play this game.
                </noscript>
           
                <div id="map1">
                    <span id="map-msg">
                        <!-- click to give focus to the document -->
                        <a href="#start" id="start-game">
                            <img src="img/snake/start_game.jpg" />
                        </a>
                    </span>
                </div>   
                <div id="stats">
                    <span class="right">Eaten:
                        <span id="stats-eaten">0</span> /
                        <span id="stats-totcherries">0</span>
                    </span>
                    Level: <span id="stats-level">0</span> |
                    Lives: <span id="stats-lives">0</span> |
                    Score: <span id="stats-score">0</span>
                </div>   
            </div>
        </div>
    </div>
</body>
</html>
Category: Web Development | Views: 354 | Added by: admin-priyank | Rating: 5.0/1
Total comments: 0
Name *:
Email *:
Code *:
Calendar
«  November 2012  »
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
252627282930
Entries archive
Our poll
Rate my site
Total of answers: 4
Site friends
  • Create a free website
  • Online Desktop
  • Free Online Games
  • Video Tutorials
  • All HTML Tags
  • Browser Kits
  • Statistics

    Total online: 1
    Guests: 1
    Users: 0
    Creative Commons License
    Free Downloads and Services by MiX1 is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
    Copyright MyCorp © 2024