Swift Snake 3D

A small extension that will let you play snake whenever you want.

Try Swift Snake  

1. Signing In Using Google

Clicking on the Sign in with Google button will open up a pop-up window prompting you to sign in with a Google account. You may create a new Google account using the pop-up window or log-in to an existing account. All in-game scores will be bound to your Google account.

2. Picking a Display Name

After signing in with Google, you will be prompted to pick a display name. This is the name that will be displayed alongside your scores on the global leaderboards. Your display name has to be less than 16 characters long and cannot contain special characters. Type your username into the white text-box and proceed by clicking the blue Confirm button.

3. Viewing Your Profile

You can view your profile by clicking your Google profile picture on the top right of the pop-up window. Here, you can see the e-mail and display name associated with your Google account.

4. Signing Out

If you want to sign out in order to switch accounts, you can do so by clicking the red Sign Out button below the profile window.


Experiencing problems? Contact: [email protected]

The Basics

Classic snake rules apply... You start out as a small purple 'head' and your goal is to grow a long 'tail' for this head by gathering food. Colliding with a wall or your own tail will cause you to lose the game. No second chances.

Controls

As explained in the small tutorial, the snake can be controlled using the Arrow Keys or the W, A, S, D keys on your keyboard. The game starts when you press the ENTER key.

2D Mode

If 3D snake isn't your cup of tea, you can always go back to regular old 2D snake using the 2D button on the bottom left of the pop-up window.

Panning the Camera

The 3D camera can be panned by clicking and dragging your mouse.

Zooming In and Out

You can zoom the 3D camera in and out using the scroll wheel of your mouse.


Experiencing problems? Contact: [email protected]

Length

Length is the most basic form of points. Each food you gather grows your tail and adds one point to your length.

Combo

Your combo increases depending on how many turns (direction changes) you take in between each food you gather. In order to preserve your combo, you have to take less than 6 turns before gathering another food. Taking 6 or more turns will break your combo and your combo counter will return to a value of 0, while taking less than 6 turns will add one point to your combo. Your combo value is important as it factors into the score your gain for each food your gather.

Score

Each food gathered is worth a certain amount of points that depends on the value of the combo counter and how many turns (direction changes) took place after the last food was gathered. Taking 3 or less turns awards 4 points, taking 4 or 5 turns awards 2 points and taking 6 or more turns awards only point. The point awarded is multiplied by the combo value (up to a maximum of 10) and then added onto the total score. The code block below shows the calculations that gathering a food leads to:


            combo += 1;
            if(turnCount < 4){
                score += 4 * Math.min(combo, 10);
            }else if(turnCount < 6){
                score += 2 * Math.min(combo, 10);
            }else{
                score += 1;
            }
                                


Experiencing problems? Contact: [email protected]

Developer

Designed and developed by Oktay Comu.
E-mail: [email protected]

Libraries

CSS and Javascript Libraries Used:
  • Babylon.js v3.3.0
  • Bootstrap v4.1.3
  • Firebase v5.5.7
  • JQuery v3.2.1
  • MongoDB v3.1.8
  • Node.js v10.13.0
  • Popper.js v1.14.5
  • socket.io v2.1.1