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
1 vote
2 answers
217 views

How would you find the most optimal path in the the traditional snake game?

I was thinking about how to implement snake today, in particular, how to ensure the snake moves optimally from one target to the next. This seems like a shortest path problem, but it's a bit tricky ...
atl123's user avatar
  • 11
-2 votes
1 answer
334 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 ...
c0der's user avatar
  • 1
0 votes
1 answer
106 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: ...
Scollier's user avatar
  • 124
0 votes
1 answer
463 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) �...
killy dima's user avatar
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 ...
anbvy's user avatar
  • 5
0 votes
1 answer
104 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 <...
anbvy's user avatar
  • 5
0 votes
1 answer
235 views

Trying to move the snake smoothly in a 2D game

...
beWiNN's user avatar
  • 15
0 votes
1 answer
89 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: ...
wixy0's user avatar
  • 67
0 votes
2 answers
300 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 ...
Vlad Stefy's user avatar
0 votes
0 answers
667 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 ...
Breadman's user avatar
0 votes
2 answers
887 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 ...
user avatar
0 votes
0 answers
80 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. ...
Dinter's user avatar
  • 1
1 vote
1 answer
168 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 ...
Freeman 123's user avatar
0 votes
1 answer
355 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: <...
Manik's user avatar
  • 107
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 ...
PaulBlart's user avatar
3 votes
1 answer
1k 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 ...
wixy0's user avatar
  • 67
0 votes
1 answer
424 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 ...
Mat Ertonn's user avatar
0 votes
0 answers
434 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 ...
gamer67's user avatar
  • 39
2 votes
1 answer
404 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 ...
Polyrogue's user avatar
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. ...
Sh.Adel's user avatar
  • 191
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 ...
Lucas Gomes's user avatar
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 ...
Patterson's user avatar
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....
FireSpark's user avatar
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 ...
user3917631's user avatar
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 ...
Eudy Contreras's user avatar
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 ...
S. Neut's user avatar
  • 105
1 vote
1 answer
44 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 ...
James Balajan's user avatar
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 ...
user3689's user avatar
  • 847
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 ...
Rawb's user avatar
  • 193
1 vote
1 answer
259 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 ...
Joachim Velzel's user avatar