Making the Snake Game in GKC

This is my first guide, so please let me know what I could’ve done better.

In this guide, I’ll walk you through creating the snake game, in which you try to guide the snake towards the food using the arrow keys. It’s a simple concept, but hard to implement in Gimkit because it isn’t designed for this.

Step 1

Go to options, then to editing options, then change these settings. This isn’t necessary, but makes the next part easier.

Step 2

Create a barrier that covers a 2x2 area, then adjust it to make it look how you want. After that, give it these settings under availability. (Edit: there should only be two zeroes)

Step 3

Copy the barrier, then put the new one right above the other.

Next, change the channels so it activates on “01+” and deactivates on “01”.

Step 4

Repeat this process until you have five barriers. Make sure to change the channels. Next, continue the process but move to the right. The first number in the channel should be its X coordinate, and the next one should be its Y coordinate. Go until you have a 10x5 grid. This might take some time.

This is what it should look like:

Step 5

Create a camera point device in the center of the group of barriers that activates on the channel “Start”, as well as a button that broadcasts on the same channel. (You might need to go to editing options and disable player collision)

Step 6

Create a teleporter that receives on channel “Start”, then surround it with four zones that are wired to teleport the player back to the teleporter. Next, make the surrounding zones broadcast on channels “Up”, “Down”, “Left”, and “Right”.

Make sure the zones are positioned as close as possible to the teleporter without the player being able to escape. You might need to turn off the camera point to test it out.

Step 7

Create the following properties:

Name Default Value
Snake 32,22,12
Direction Right
X 3
Y 2
FoodX 7
FoodY 2
Step 8

Create four triggers that receive on the channels you created in step 6.

Add this code to each block, but make the direction in the condition the OPPOSITE of the channel it receives on and set the property to the same direction as the channel it receives on. This is an example from the “Up” trigger.

Step 9

Create another trigger and give it these settings. This trigger will essentially control the game. (You can change the delay later to change the speed of the game)

Now, add this block code:



Step 10

Create an end game device that ends when receiving on channel “End”, then create a trigger that receives on channel “GameOver?” and add this code:



Step 11

Create another trigger that triggers when receiving on channel “MoveFood”, then give it this code:


Step 12

For the barriers highlighted below, turn on “active on game start”.


(Side note: I just realized that you can click while holding shift to teleport in the GKC editor)

Step 13

You’re done! Now you can add some finishing touches such as a border around the playing area or a lobby by the start button.

20 Likes

Perhaps you could make a gif presenting this so we can have a visualization?

3 Likes

I’m having trouble uploading it. I’ll do it as soon as I can, but I’m out of time so it might be as late as tomorrow.

4 Likes

the guides actually good, it includes images and stuff, and also explains why you have to do certain things,

Overall, I would say it’s a well-made guide, even without the fact that it’s the first guide you’ve made
:+1:

5 Likes

This is actually really good, I’ve never even considered if Snake could be implemented.

Good job

2 Likes

This is great work especially for your first guide, this is awesome!

2 Likes

Great guide! A suggestion: maybe use triggers instead of zones to check in which direction the player wants to move because triggers are more memory-efficient than zones.

2 Likes

I considered doing that but there’s a slight delay between when you get off of it and when it goes back up (although that might just be animation) and you could also fit through diagonally. I probably could’ve made it work, but I decided to just stick with what I knew worked.

1 Like

No way a basic made this :exploding_head:

beautiful guide :heart:

9 Likes

For a first guide, I’d say this is excellent! Good job. However….

  • Maybe try adding some ‘fun’ in there, like jokes. Formal guides get boring, and since we have a small attention span, we click off (blehhh)
  • Format it a little more - don’t just stick to summaries! Add subtitles, and different sections
  • ‘Tinker with it’ - Add a section where you give ideas as to how people could make their game unique!

Overall? Solid 8/10. Good job. Now go and make another guide, because you’re smart (and I’m…different. Trust.)

6 Likes

When I finished Step 9, I didn’t get 75/75 blocks. I got 69/75. I looked at your pictures and I found this small mistake.


What happened with that piece of code?

I made an error and when I went back to fix it I ended up using less block code and forgot to get rid of that side comment. I also only updated one of the screenshots because I didn’t change anything in the second (besides that tiny piece of a block that you noticed).

2 Likes

Another thing is that (I finished all the steps) when I started the game it waited a few seconds then ended. So I don’t what exactly the problem is.

Can you be more specific on what happened before the game ended?

2 Likes

Yes I’m currently making a gif.
Edit: the gif is way to big to fit even when I tried to compress it.

Try to describe it then.

1 Like

This is what the map looks like before I start.


I press start game. My character gets spawned in next to the button. I press it. Camera view gets turned on, I’m then looking at the 4 barriers for a few seconds.

Then the game ends itself.

1 Like

That’s odd. Can you send me screenshots of the main block code and one of your barrier’s availability settings?

2 Likes

Yes. Which block code do you want?

The one that triggers when receiving on start and loop.

2 Likes