Questions tagged [snake]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
62 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
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. ...
1
vote
1answer
82 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
1answer
38 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
0answers
55 views

How to stop snake game stuttering?

I have the following code and it seems to work pretty well except that every once in a while the program stutters and the snake teleports forward a few spaces. I can't tell what this is related to. <...
0
votes
1answer
235 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 ...
1
vote
1answer
215 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 ...
0
votes
1answer
162 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
316 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 ...
2
votes
1answer
121 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
1answer
697 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. ...
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 ...
1
vote
1answer
1k 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
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....
5
votes
2answers
957 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 ...
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 ...
0
votes
3answers
2k 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
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 ...
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 ...
1
vote
1answer
240 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 ...