Windows movement snake

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.
 

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