• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Programming Animate

N

nazar79

Guest
Hello, did the platformer for lessons "Advanced platformer" (as standard physics has ceased to arrange) and encountered a problem in 4 lessons, namely animation. Everything is beautiful there, but Density is set to 0, and I need it to have a certain value. Now I realized this: The player's collision with the box-we change the image, but the animation looks like a wrench, apparently due to the fact that there is no constant collision when moving. Can anyone tell me how to make an adequate animation? Here is the source https://yadi.sk/d/D7SALeFv3FMEfL
 
G

GriffinTGA

Guest
I am not entirely sure what you're asking, but, here is code for my animations.

// Control the sprites
if (yprevious != y) {
sprite_index = spr_jump;
image_speed = 0;
image_index = y>yprevious;
} else {
if (xprevious != x) {
sprite_index = spr_walk;
image_speed = 1;
} else {
sprite_index = spr_stand;
image_speed = 1;
}
}

// Control the direction of the player facing
if (xprevious < x) {
image_xscale = 1;
} else if (xprevious > x) {
image_xscale = -1;
}
 
N

nazar79

Guest
Thanks for your reply, but I'm using box2d physics
In order to understand the question you need to download the source. The problem is that my animation twitches when I collide with a box, a wheel. And sometimes there is an animation zavasanie. I'm ready to even pay for solving the problem.
 
Top