yes but you know how direction changes when i press the different keys right?
case key of
vk_left: if not(direction = 2) then direction := 1;
vk_right: if not(direction = 1) then direction := 2;
vk_up: if not(direction = 4) then direction := 3;
vk_down: if not(direction = 3) then direction := 4;
end;
and this is the code i am using
so let's say the direction is 1 so it's going left. And if i press right it won't work because it only works when the direction is not 1. But if change directions really quickly bu pressing up key and right key, it just goes left instead of going up and left.
And i think this is because the direction is changed but the snake didn't move because i pressed so quickly
so it's vk_left --> vk_up --> vk_right
direction 1 --> direction 3 --> direction 2
so the direction was changed without any problems but the snake just went to right from left without going up.
so is there any way i can fix this problem? if my explanation is not clear please compile the game and see what happens if you press two keys really quickly