Posted on 11 Comments

Snake Cubed Competition and Daily Entry

Download on Android and IOS







*The android and ios version is free to play and is setup up for multiplayer but these versions are not yet set up to be used in this competition.

Competition is Currently Closed

Check out this competitions winners in the winner section of this post.

Please come back for future competitions and in the meantime check out some of our tutorials, code, and designs. https://www.infogamerhub.com/tutorials/ Designs: https://www.infogamerhub.com/design/

Please Invite and Challenge Your Friends!

We want to make it really simple for you to invite and challenge your friends. Copy the text and paste when you click to share via Facebook, Twitter, etc. Put your display name and high score in the blanks and invite some friends you want to challenge.

Can you beat my #HighScore of ___!?!? There’s a current competition running and you can join. My display name is ___ and I challenge you! Let me know your display name in the comments. #SnakeCubed #Competition #Challenge #Play https://www.infogamerhub.com/snake-cubed-competition/

Win an Amazon Gift Card – see details below

Unity WebGL Player | SnakeCubed


Super Important Tips for First-Timers!

  • New to InfoGamer? Register for your free account here.
  • Do not use your email address for your in-game display name. Otherwise, random people could email you. Display names are used in-game and posted in the winner’s section.
  • Your display name is permanent.
  • To pick colors or scroll the high scoreboard click and drag instead of using the mouse wheel.
  • Infogamerhub.com will never ask for passwords or personal account information.
  • Warning turning on the edges of the cube can make the snake leave the cube, be careful. 😉
  • Nathan and Mark like to compete and play our games too, but don’t worry our high scores and daily entries don’t count towards winning the prizes. See if you can beat our high scores! Our display names are Nathan IGH (DEV) and Mark IGH (DEV).
  • The more subscribers we get, the better prizes we can offer, so please share this post!
  • See below for details about the competition rules and regulations.

Trouble Shooting

  • WebGL is not supported on mobile devices but if you go to setting and use the view as a desktop version it seems to work on my phone.
  • If you are experiencing other troubles with Snake Cubed Please leave us a comment at the bottom of the page.
  • If you don’t see the leader board on the game after logging in your high scores won’t be recorded. Let us know of the issue with your game display name and we will try and help.

How to Play

Controls: To turn the snake, use keys A and D or the Left and Right arrows. If you have a touch screen, you can touch the left and right side of the game screen to turn those directions.

Objective: The snake slithers around the cube. Control the snake to collect blocks which will make your snake grow. The longest snake gets the highest score.

Warnings: Running the snake into its own body will end the game. Turning the snake the wrong direction on the edges of the cube can result in the snake leaving the playfield. This is difficult to recover from and will also likely end the game.

Become a Member

We want to bring more tutorials, models, packages, games, group projects, prizes and competitions to you. We are looking into more ways to include members in our game development and our gaming community. Click below to become a member.

Rules

  • Have fun!
  • Keep it clean. Display names including profanity, hate speech, and vulgar references won’t be eligible to win.
  • The login to our website and the login to the in-game account is required but the paid subscription is not necessary for daily entry.
  • Each player can submit ONE ENTRY PER DAY during the competition by logging in to the Snake Cubed game.
  • Players can log in and play multiple times per day but only one daily entry will be counted towards the competition.
  • Competition and daily entry are only available on WebGL. Future competitions may be available on additional platforms.
  • The competition will allow for two winners. A prize will be issued to the player with the highest score. A prize will also be issued to a randomly selected player who entered the competition daily. Winners will be determined and contacted via email within 24 hours of the competition ending. If there is no response from a winner after three days we will select the next eligible winner.
  • In the event of a tie, the highest score winner will be determined by random selection.
  • Only one prize issued per player per month.
  • For any unforeseen issues and errors with the competition, InfoGamer has the right to make any changes as needed.
  • High scores will be reset at the beginning of each competition.
  • Players found cheating will be excluded from winning prizes.

Prizes

  • The highest score will receive $20.00 Amazon gift card
  • Randomly selected daily entries $20.00 Amazon gift card

Winners

Winners are being contacted via email and have 3 days to respond to our email.

High Score Winners 4/7/2020: (due to a minor issue, Nathan and Mark have decided there are two high score winners for the competition ending 4/7/2020)

Congrats to both lolomagz100 with a 176 and MrJohnWeez at 172 it was a very close game.

Random Daily Entry Winner 4/7/2020:

Congrats to our Random Daily Entry Dad1

High Score Winner 4/15/2020:

Congrats madyoshi with a winning high score of 255.

Random Daily Entry Winner 4/15/2020:

Congrats to our Random Daily Entry bsmith950.

Potential Future Prizes

We have ideas for potential prizes in future competitions and would like your input. Some of the links below are for products we’ve used and would recommend. Others have good reviews. Leave us a comment at the bottom of the page with your suggestions for future prizes. We’re still thinking this through, but to avoid exorbitant shipping costs, some prizes may be sent as an equivalent Amazon gift card in lieu of the listed prize. Links below are affiliate links.

I recently picked up the Logitech MX keyboard and have found it to be a great keyboard. It’s responsive and easy to switch between different devices. I have not tested this keyboard for gaming or longevity but it is pretty awesome to use one keyboard instead of 3. What do you guys think of this being a future prize?

We could also offer a $100 Amazon gift card and you could put it towards a monitor like this one. It has good specs and pretty good reviews.

We have been using a similar Blue microphone for our recordings and gaming and have found this microphone to be sufficient. This could be another option for a future prize.

Best of luck winning the prizes. We need your help to continue awarding prizes and setting up other competitions like this one. Please remember to share this Snake Cubed Competition post and thanks for reading.

Posted on

How to Make Snake

Download this Game Project

Lesson 1 Setup

In this lesson, we will go through all the steps we need to take to set up our Unity project for creating the classic game Snake. We will go over setting up our file system and as well our main game scene.

Lesson 2 Player Movement

In this lesson, we will teach you how to create the snake object and we will show you how to program the basic forward movement of the snake object.

Lesson 3 More Movement

This is the second half to creating the movement of the snake object.

Lesson 4 Changing Direction

Now that we have the basic movement of the snake object we need to program the controls to change the direction of the snake when the player presses a key on the keyboard.

Lesson 5 Growing Size

For this lesson, we will teach you how to program your snake so that it will have a size to its length. This will make it so latter when we program the eating of food the snake can get bigger and bigger.

Lesson 6 Food System

In this lesson, I will show you how to create a food generator. This mechanic makes it so that food will spawn at a random position in your scene, getting us ready for when our snake starts eating the food.

Lesson 7 Scoring

This is where we finally get to program the interaction between the snake and the food objects. This interaction will give a point to the player, make the snake grow by one, respawn the food, and add entertainment to our game.

Lesson 8 Game Over

Although our game now has an entertainment factor it is not any bit challenging which means it is still boring. To fix this we will program the game over for the game which occurs when the player runs into themselves.

Lesson 9 Main Menu

Now that the basics of our game are made we will now show you how to create the main menu for this game and how to program the transition between our menu scene and our game scene.

GameController.cs

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class GameController : MonoBehaviour {

	public int clock;
    public int maxSize;
    public int currentSize;
    public int score;
	public bool play;
	public float speed;
	public int NESW;
    public int lEdge;
    public int rEdge;
    public int tEdge;
    public int bEdge;
	public GameObject snake;
    public GameObject food;
    public Snake head;
    public Snake tail;
    public Text scoreText;
   // public UnityAds unityAds;
   public Vector2 newVect;
    public GameObject currentFood;

    private Touch initialTouch;
    private float distance;

    public bool hasTurned;

    // Use this for initialization
    void OnEnable()
    {
        Snake.hit += hit;
    }
    void Start()
    {
        InvokeRepeating("TimerInvoke", 0, .1f);
        FoodFunction();
    }
    void OnDisable()
    {
        Snake.hit -= hit;
    }

    // Update is called once per frame
    void Update()
    {
        ComChangeD();
        if(currentFood = null)
        {
            FoodFunction();
        }
    }

    void TimerInvoke()
    {
        Movement();
        StartCoroutine(checkVisible());
        if (currentSize >= maxSize)
        {
            TailFunction();
        }
        else
        {
            currentSize++;
        }
        hasTurned = false;
    }

    void Movement()
    {
        GameObject temp;
        newVect = head.transform.position;
        switch (NESW)
        {
            case 0:
                newVect = new Vector2(newVect.x, newVect.y + 1);
                break;
            case 1:
                newVect = new Vector2(newVect.x + 1, newVect.y);
                break;
            case 2:
                newVect = new Vector2(newVect.x, newVect.y - 1);
                break;
            case 3:
                newVect = new Vector2(newVect.x - 1, newVect.y);
                break;
        }
        temp = (GameObject)Instantiate(snake, newVect, transform.rotation);
        head.SetNext(temp.GetComponent<Snake>());
        head = temp.GetComponent<Snake>();

        return;
    }

    void ComChangeD()
    {
        if (!hasTurned)
        {
            if (NESW != 2 && (Input.GetKeyDown(KeyCode.UpArrow)|| Input.GetKeyDown(KeyCode.W)))
            {
                NESW = 0;
                hasTurned = true;
            }
            if (NESW != 3 && (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D)))
            {
                NESW = 1;
                hasTurned = true;
            }
            if (NESW != 0 && (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S)))
            {
                NESW = 2;
                hasTurned = true;
            }
            if (NESW != 1 && (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A)))
            {
                NESW = 3;
                hasTurned = true;
            }
            
        }
    }

    void TailFunction()
    {
        Snake tempSnake = tail;
        tail = tail.GetNext();
        tempSnake.removeTail();
    }

    void FoodFunction()
    {
        int xPos = Random.Range(rEdge, lEdge);
        int yPos = Random.Range(bEdge, tEdge);

        currentFood = (GameObject)Instantiate(food, new Vector2(xPos, yPos), transform.rotation);
        
    }

    IEnumerator CheckRender(GameObject IN)
    {
        yield return new WaitForEndOfFrame();
        if (IN.GetComponent<Renderer>().isVisible == false)
        {
            if (IN.tag == "Food")
            {
                Destroy(IN);
                FoodFunction();
            }
        }
    }

    void hit(string WhatWasSent)
    {
        if (WhatWasSent == "Food")
        {
            FoodFunction();
            maxSize++;
            score++;
            scoreText.text = score.ToString();
            int temp = PlayerPrefs.GetInt("HighScore");
            if (score > temp)
            {
                PlayerPrefs.SetInt("HighScore", score);
            }
        }
        if (WhatWasSent == "Snake")
        {
            CancelInvoke("TimerInvoke");
            Exit();
        }
    }

    public void Exit()
    {
        SceneManager.LoadScene(0);
    }

    void wrap()
    {
        if (NESW == 0)
        {
            head.transform.position = new Vector2(head.transform.position.x, -(head.transform.position.y - 1));
        }
        else if (NESW == 1)
        {
            head.transform.position = new Vector2(-(head.transform.position.x - 1), head.transform.position.y);
        }
        else if (NESW == 2)
        {
            head.transform.position = new Vector2(head.transform.position.x, -(head.transform.position.y + 1));
        }
        else if (NESW == 3)
        {
            head.transform.position = new Vector2(-(head.transform.position.x + 1), head.transform.position.y);
        }
    }

    IEnumerator checkVisible()
    {
        yield return new WaitForEndOfFrame();
        if (!head.GetComponent<Renderer>().isVisible)
        {
            wrap();
        }
    }
}

Snake.cs

using UnityEngine;
using System.Collections;
using System;

public class Snake : MonoBehaviour {

    public Snake next;
    static public Action<string> hit;
   // static public Action<GameObject> wrap;

    public void SetNext(Snake inner)
    {
        next = inner;
    }

    public Snake GetNext()
    {
        return next;
    }

    public void removeTail()
    {
        Destroy(this.gameObject);
    }

    void OnTriggerEnter(Collider other)
    {
        
        
        if(hit != null)
        {
            hit(other.tag);
        }
        if (other.tag == "Food")
        {
            Debug.Log(other.tag);
            Destroy(other.gameObject);
        }
    }
}

MMController.cs

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class MMController : MonoBehaviour {

    int HS;
    int LS;
    public Text HSText;
    public Text LSText;

    public GameObject mainPanel;
    public GameObject settingPanel;
    public Color onColor;
    public Color offColor;
    public Image [] speedBars;

    void Start()
    {
        if(PlayerPrefs.GetInt("Speed") == 0)
        {
            PlayerPrefs.SetInt("Speed", 10);
        }
        Speed(PlayerPrefs.GetInt("Speed"));
    }

    void Update()
    {
        if (Input.GetKey(KeyCode.Escape))
        {
            Application.Quit();
        }
    }

    void OnEnable()
    {
        HS = PlayerPrefs.GetInt("HighScore");
        LS = PlayerPrefs.GetInt("CurrentScore");
        HSText.text = HS.ToString();
        LSText.text = LS.ToString();
    }

    public void PlayFunction()
    {
        SceneManager.LoadScene(1);
    }
    public void youTubeLink()

    {
        Application.OpenURL("https://www.youtube.com/channel/UCyoayn_uVt2I55ZCUuBVRcQ");


    }

    public void SettingsFunction()
    {
        mainPanel.SetActive(false);
        settingPanel.SetActive(true);
    }

    public void BackFunction()
    {
        mainPanel.SetActive(true);
        settingPanel.SetActive(false);
    }

    public void Speed(int value)
    {
        for (int i = 0; i < value; i++)
        {
            speedBars[i].color = onColor;
        }
        for (int i = value; i < 10; i++)
        {
            speedBars[i].color = offColor;
        }
        PlayerPrefs.SetInt("Speed", value);
    }
}
using Photon.Chat;
using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PhotonChatManager : MonoBehaviour, IChatClientListener
{
    #region Setup

    [SerializeField] GameObject joinChatButton;
    ChatClient chatClient;
    bool isConnected;
    [SerializeField] string username;

    public void UsernameOnValueChange(string valueIn)
    {
        username = valueIn;
    }

    public void ChatConnectOnClick()
    {
        isConnected = true;
        chatClient = new ChatClient(this);
        //chatClient.ChatRegion = "US";
        chatClient.Connect(PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat, PhotonNetwork.AppVersion, new AuthenticationValues(username));
        Debug.Log("Connenting");
    }

    #endregion Setup

    #region General

    [SerializeField] GameObject chatPanel;
    string privateReceiver = "";
    string currentChat;
    [SerializeField] InputField chatField;
    [SerializeField] Text chatDisplay;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (isConnected)
        {
            chatClient.Service();
        }

        if (chatField.text != "" &amp;&amp; Input.GetKey(KeyCode.Return))
        {
            SubmitPublicChatOnClick();
            SubmitPrivateChatOnClick();
        }
    }

    #endregion General

    #region PublicChat

    public void SubmitPublicChatOnClick()
    {
        if (privateReceiver == "")
        {
            chatClient.PublishMessage("RegionChannel", currentChat);
            chatField.text = "";
            currentChat = "";
        }
    }

    public void TypeChatOnValueChange(string valueIn)
    {
        currentChat = valueIn;
    }

    #endregion PublicChat

    #region PrivateChat

    public void ReceiverOnValueChange(string valueIn)
    {
        privateReceiver = valueIn;
    }

    public void SubmitPrivateChatOnClick()
    {
        if (privateReceiver != "")
        {
            chatClient.SendPrivateMessage(privateReceiver, currentChat);
            chatField.text = "";
            currentChat = "";
        }
    }

    #endregion PrivateChat

    #region Callbacks

    public void DebugReturn(DebugLevel level, string message)
    {
        //throw new System.NotImplementedException();
    }

    public void OnChatStateChange(ChatState state)
    {
        if(state == ChatState.Uninitialized)
        {
            isConnected = false;
            joinChatButton.SetActive(true);
            chatPanel.SetActive(false);
        }
    }

    public void OnConnected()
    {
        Debug.Log("Connected");
        joinChatButton.SetActive(false);
        chatClient.Subscribe(new string[] { "RegionChannel" });
    }

    public void OnDisconnected()
    {
        isConnected = false;
        joinChatButton.SetActive(true);
        chatPanel.SetActive(false);
    }

    public void OnGetMessages(string channelName, string[] senders, object[] messages)
    {
        string msgs = "";
        for (int i = 0; i &lt; senders.Length; i++)
        {
            msgs = string.Format("{0}: {1}", senders[i], messages[i]);

            chatDisplay.text += "\n" + msgs;

            Debug.Log(msgs);
        }

    }

    public void OnPrivateMessage(string sender, object message, string channelName)
    {
        string msgs = "";

        msgs = string.Format("(Private) {0}: {1}", sender, message);

        chatDisplay.text += "\n " + msgs;

        Debug.Log(msgs);
        
    }

    public void OnStatusUpdate(string user, int status, bool gotMessage, object message)
    {
        throw new System.NotImplementedException();
    }

    public void OnSubscribed(string[] channels, bool[] results)
    {
        chatPanel.SetActive(true);
    }

    public void OnUnsubscribed(string[] channels)
    {
        throw new System.NotImplementedException();
    }

    public void OnUserSubscribed(string channel, string user)
    {
        throw new System.NotImplementedException();
    }

    public void OnUserUnsubscribed(string channel, string user)
    {
        throw new System.NotImplementedException();
    }

    #endregion Callbacks
}
Posted on

Play Classic Snake Made with Unity

Classic Snake

Play our version of classic snake that we created with the Unity game engine. Do you want to learn how to make this classic Snake? If you want to learn how to make video games this is a great place to start. We have a complete tutorial series on how to make classic Snake with the Unity game engine. We will take to step by step and by the end of our series you will have your own version of classic Snake.

Learn how to make classic Snake here.

Play our version of Tic Tac Toe made in the Unity game engine. Do you want to learn to make
Learn to make 2048: https://www.infogamerhub.com/2048-lesson-1/
Presidential Slap is now available to play on both Android and iOS. Show your support for us by playing our
Learn to Create
Classic Snake
Play our version of classic snake that we created with the Unity game engine. Do you want to learn how
Download on Android and IOS *The android and ios version is free to play and is setup up for multiplayer
Play our version of Flappy Bird made with the Unity game engine. Do you want to learn how to make