Questions tagged [snake]

Snake is the common name for a video game concept where the player maneuvers a line which grows in length, with the line itself being a primary obstacle. Use this tag when asking questions relating to such games.

Filter by
Sorted by
Tagged with
-2 votes
1 answer
197 views

How to randomize all the colors to different colors every time the snake eats and grows?

I'm new to python and am making snake for a project/ I'm not sure how to randomize all the colors to different colors every time the snake eats and grows. I've looked up multiple things and nothing ...
0 votes
1 answer
98 views

Strange flashing cube bug in snake game

I'm trying to make a simple snake game in C and OpenGL, and I have this at the moment, which runs almost perfectly: ...
0 votes
1 answer
340 views

Snake Game body rotation

I am currently trying to make a snake game with Unity. I'm a beginner at C# so I decided to make a game that seemed easy. With the help of this tutorial How to make Snake in Unity (Complete Tutorial) �...
0 votes
1 answer
71 views

Some objects only rendering half of the screen in snake game

I'm trying to make a basic snake game with OpenGL. I hold all the game object locations in a matrix called MAP. And when i render them, i operate the location info ...
0 votes
1 answer
95 views

Input reaction is slow in two player snake game

i'm trying to make a two player console snake game. One of the snakes is controled by 'wasd' and other 'uhjk'. I have two function to get the keys getKEYS1() and <...
0 votes
1 answer
182 views

Trying to move the snake smoothly in a 2D game

...
0 votes
1 answer
314 views

how to join the body of snake in 2D snake game

i'm making a snake game in javaScript from scratch. The problem is that the snake looks disjoint(see image). How can I connect the body(rectangles) of the snake? here is the code of drawing snake: <...
0 votes
1 answer
85 views

Distance between moving, rotated rectangles in snake game

I am trying to implement basic Snake game with movement based on timestep. For now I've got something along those lines: Update function: ...
1 vote
2 answers
2k views

Snake game made in processing

I have been working on this snake game for a few days, and I have the basics down, but I was wondering if anyone could help me figure out the tail. I need it to follow the body, as it does in the ...
5 votes
2 answers
1k views

Snake movement in monogame

Noobie here... I've started learning monogame development and currently working on a simple snake game. I'm having trouble with the snake's movement, I figured I could make it tile-based movement but ...
0 votes
1 answer
391 views

Snake game steering with Java FX

I am currently trying to make a snake game with Java FX, I read several posts about it and I understand on theory how to move the snake body (for each part of the snake reference the previous one and ...
0 votes
1 answer
1k views

Pygame moving rectangle

I am coding a snake game with pygame for Python 3.6 and wonder how I can make the snake move all the time, changing direction when buttons right, down, left and up pressed, like in the real snake game....
0 votes
2 answers
252 views

How to make the snake bodyParts follow same places and directions as the player on a curved surface?

I try to make a game like the classic snake game but on a round ground (Earth). On a plane, the script works well, but when i moved it on a sphere, the bodyparts (prefabs), are not working good as you ...
0 votes
0 answers
639 views

How to make 3D snake with procedural mesh in Unity

Im currently learning Unity3D and I would like to recreate the old Nokia game "Snakes" (example video: https://www.youtube.com/watch?v=FXg3jVG-tXs&ab_channel=aantv, play it at 1:30 and ...
0 votes
2 answers
761 views

Smooth out movement of the snake in a 2d Snake game

I am working on a 2-D snake game in C++ with the SFML library. I would like to smooth out the movement of my snake as it looks extremely choppy currently. How the Snake moves The snake is made up of a ...
0 votes
0 answers
71 views

AI for 1v1 snake

I've got a task for job application to create a snake AI that can defeat their basic AI. Searching in this topic I've found that it's very similar to Tron and it's solved mostly by minimax algorithm. ...
1 vote
1 answer
162 views

Javascript snake game, configurable section distance

I want to make a snake game. In a classic game the snake moves in 4 directions, I want the player to move in all directions by mouse input, similar to slither.io Right now the tail section changes ...
0 votes
1 answer
2k views

How to reset snake in javafx game?

I am making snake in javafx, I have completed my game, and I am trying to add a reset button in my game. When I click the reset key (ENTER), the game should reset, but the arraylist that stores the ...
0 votes
0 answers
428 views

How can I move the snake toward the mouse cursor?

I am making a snake game. I have got it to animate. I just want it to follow the mouse pointer. I am able to find the mouse cursor position. I am also to get my snake to move to the right. What I want ...
3 votes
1 answer
984 views

Tile based smooth snake movement

while making my own Snake implementation I decided to use delta time for smoothing movement on screen. The problem is that before Snake was moving fixed amount of pixels every frame, but now when ...
2 votes
1 answer
346 views

Snake AI - Is a Hamiltonian approach valid for all grid sizes?

So, as has been done many times before, I am designing an AI that can play Snake as effectively as possible. It didn't take me long to find this extremely useful thread here: How to find a safe path ...
1 vote
1 answer
2k views

2D snake game ( how to rotate snake's head with movement ?)

I want to know: how to rotate snake's head with movement how to make tail prefabs (body) follows head direction. ...
9 votes
2 answers
3k views

Designing Snake AI

I'm new to this gamedev stackechange but have used the math and cs sites before. So, I'm in a competition to create AI for a snake that will compete with four other snakes in 5 minute rounds where ...
1 vote
2 answers
3k views

How to make snake movement smooth not grid based like slither.io snake?

I try to find the right formula to mimic the smooth non-grid movement of the slither.io snake. I can do it manually to save each point the "head" movement went and do some interpolation in between ...
1 vote
1 answer
256 views

How would a sprite spawn more sprites under themself every second?

I am making a snake game and am having trouble to make the snake go longer, at the moment when I run the program, I just have the snake head eating apples. But I want the snake head(30x30) to spawn ...
8 votes
2 answers
7k views

How to find a safe path for an AI snake?

I have been working on a game in which a player can compete with a snake ai to get the most apples. The current path finding technique i use (A* Pathfinding) works fine. But I am struggling with ...
2 votes
2 answers
2k views

How to create a grid movement like the oldschool snake game?

I got 2 problems with the game, I don't know how make my GameObject (snake head) move based in a grid for some reason I don't know it moves freely on the screen. The tail keep instantiating above ...
0 votes
3 answers
4k views

Snake game - Snake Collision

So I am making a snake game as final assignment for semester 1 of my game dev study. We have to write it in C# in Visual Studio 2015. I am using the .NET 3.5 framework. So basically how my snake ...
1 vote
1 answer
39 views

Having trouble with constructors and the deque class [closed]

I've recently been trying to make a better version of my previous remake of the classic snake game by implementing data encapsulation and abstraction. I also decided to replace my horrible choice of a ...