• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows movement snake

A

answersearcher

Guest
2020-03-30 (2).png2020-03-30 (1).png

Is there any reason for the movement of the haed because if it turns then there's a gap between the body and the head.
 
A

answersearcher

Guest
This is the code by the step event

if (dir == state.left) {
image_angle = 180;
x -= move_size;

}

if (dir == state.right) {
image_angle = 0;
x += move_size;

}

if (dir == state.up) {
image_angle = 90;
y -= move_size;

}

if (dir == state.down) {
y += move_size;
}

if (dir == state.down) {
image_angle = -90
}


if keyboard_check_pressed(vk_left) {
dir = state.left;
}
if keyboard_check_pressed(vk_right) {
dir = state.right;
}
if keyboard_check_pressed(vk_up) {
dir = state.up;
}
if keyboard_check_pressed(vk_down) {
dir = state.down;
}
 

Nidoking

Member
Other than having two checks for state.down when one would do, this is fine, but you're missing the part that draws or places the body segments i.e. the part where the problem is.
 
A

answersearcher

Guest
What do you mean with: ''Draws or places the body segments''?
 

Nidoking

Member
There are body segments as well as the head segment, correct? These body segments are drawn, hence they are visible in the pictures. For them to be drawn, something must be drawing them. Either you have instructions to draw them, or you have assigned them a sprite and placed them in locations within the game, where they are drawn. Therefore, they are either drawn, or placed to be drawn. That is what I mean.
 
Top