

For example, put this in the Step Event of an invisible object that sits in each level: Try deactivating anything that's outside of the player's view, and destroy anything that's outside of the room. To that effect, instance_destroy() and instance_deactivate() are your friends. And the more work an object is doing each step, the slower it will be, so take care to make sure nothing is awake if it's not needed. I've heard that ~50 instances is the most that you should have awake at once. Deactivate/Destroy Unused Instances Object instances slow down Game Maker a LOT. And now I pass that knowledge down to you! Here are some tips, from what I think is the most important, to leaster. But with a little research, and some good advice from experienced GM users, I started to make some optimizations to my game that significantly increased its speed. Game Maker is kind of notorious for being slow anyway, so it didn't take long for me to hit its limits.

So, when moving downwards because of gravity, your character will change animation from falling to idling/running, and the glitch repeats.Optimizing Your Game Maker Game Intro: Since I'm a pretty mediocre programmer, I often go for an easy solution to my coding problems rather than an efficient one. Because of the precise collision mask your sprites have, there will be a step in which your code will be checking for collisions below ( place_meeting(x,y+1,obj_wall)) when your character actually isn't touching the ground in position (x,y+1), assuming then he's jumping/falling. When your character runs, his legs move and - right like in real life - there's a brief moment when both of them aren't touching the ground. The reason your character animation glitches is because of the related collision mask. Your code is fine as is, maybe some lines can be written better and optimizations are possible. If (vsp 0) sprite_index = spr_player_jump Key_jump = keyboard_check_pressed(vk_space) Here's the code I'm using: //get player input Everything was working fine before I added the "animate" section. I'm very new to game maker and programming in general, so I'm probably making some dumb mistakes.

While moving sideways, the sprite slowly sinks into the floor. Both of the sprites flash when this happens. When I move side to side, the jump sprite moves along the ground while a single frame of the running sprite animation shows up above it and to the side. It now flashes in the same location as the run sprite when moving to the side. EDIT: I changed the origin of the run sprite to the center, and it is no longer hovering above the jumping sprite.
