Questions tagged [snake]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
2answers
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 ...
8
votes
2answers
6k 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 ...
5
votes
2answers
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 ...
2
votes
2answers
1k 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 ...
2
votes
1answer
181 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 ...
2
votes
1answer
328 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 ...
1
vote
1answer
965 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. ...
1
vote
1answer
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 ...
1
vote
1answer
37 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 ...
1
vote
2answers
2k 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
1answer
97 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 ...
1
vote
1answer
241 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 ...
0
votes
2answers
131 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
1answer
1k 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
3answers
3k 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 ...
0
votes
0answers
15 views

Snake game collision with wall and reset

So I have a collision with itself and collision with the apple. I just cant figure out how to get it to collide with the wall. What my teacher helped me with was it made it teleport to the other side ...
0
votes
1answer
47 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: ...
0
votes
0answers
33 views

How to restart my Snake game after Game Over

I'm new into programming and trying to implement a way to restart my snake game after the game is over. I tried several ways but none worked out for me. Can someone maybe help me? ...
0
votes
0answers
231 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
0answers
31 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. ...
0
votes
1answer
88 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
1answer
241 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
0answers
339 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 ...
0
votes
2answers
48 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 ...
-1
votes
1answer
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....