Tag Archives: jquery

Simple Snake game in Jquery

There are several tutorials on the internet to create simple snake game in query. I readh through https://www.sourcecodester.com/tutorials/javascript/11260/creating-very-simple-snake-game-using-jquery.html and decided to enhance it.

The new code has following advantages over the original one:

  1. Added pause and play option
  2. Once the game ends, stops play. Original code just restarted the game
  3. Changed the position of game name and score
  4. Replaced absolute font size with relative sizes.

I created a github and uploaded the code for this simple game. You can also play it here


I have started working on a greasemonkey script. I tried using jquery but sadly the page I was working on doesn’t include jquery. Found this link which allows you to use jquery.

Later found out, it wasn’t required on the newer versions of greasemonkey which allows loading external js/css using @require. The mistake I was doing was: the @require tags are required between

// ==UserScript==
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==

This is cleanly mentioned at the greasespot wiki here. That’s why the say read the manual.