Your code makes me feel gross inside
if(other.x>x-5) if(other.x<x+5) if(other.y>y1-5) if(other.y<y1) &&. If you plan to use Enigma, that's sense. If you're trying to be fast on GM, that's not how to go about it. Going about it is to use the more efficient alternative methods offered
left = 0; right = 0; up = 0; down = 0; jump = 0; if(keyboard_check(vk_left)){ left = 1; } if(keyboard_check(vk_right)){ right = 1; } if(keyboard_check(vk_up)){ up = 1; } if(keyboard_check(vk_down)){ down = 1; } if(keyboard_check(vk_space)){ jump = 1; }
Should be
left=keyboard_check(vk_left) right=keyboard_check(vk_right) up=keyboard_check(vk_up) down=keyboard_check(vk_down) jump=keyboard_check(vk_space)
if(up){ vspeed = -120 } if(down){ vspeed = 120; }
else if. Use it
hspeed = right*125-left*125;
Consistency. Use it. If you're going to do stuff like that, don't have the if else elsewhere doing so. Personally, I'd use 125*(right-left)
As for your bug, such seems to be inherit to overly stateful code
|