T
Tofu Heavy Industries
Guest
1) Animation issue: Im using a 8 frame sprite with 2 frames per direction. When you initially move in a direction, the animation will overflow by a single frame before getting into the correct two-frame loop. How do I prevent the initial overflow?
Each Keyboard arrow key has this exact code (except for direction/frame #).
2) Trying to prevent diagonal movement (with the same above code)
3) Snap to a 16 pixel grid if possible.
Right now, each move direction code is attached to their separate arrow key events. Theres a thread in this forum that has a nice example of using a single step event that prevents diagonals and also snaps to a grid, but I don't know how to add the animation to it.
Each Keyboard arrow key has this exact code (except for direction/frame #).
Code:
if place_free(x-8, y) {
x -= 4;
direction = 180;
if (global.zone_fight == 1) battle_steps_traveled += 4;
image_index +=0.4;
if ( image_index >= 4 ) { image_index = 2; }
}
3) Snap to a 16 pixel grid if possible.
Right now, each move direction code is attached to their separate arrow key events. Theres a thread in this forum that has a nice example of using a single step event that prevents diagonals and also snaps to a grid, but I don't know how to add the animation to it.