Animations

This forum is currently in read-only mode.
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I am having some fairly severe problems in general with platform movement. I have NEVER made a platform game of any kind... I have always done top down view games... always.

    I have followed the steps you outlined in this thread deadeye, but I am still having trouble ranging from animations locking up after non-looped animations have finished... even if I put "reset to frame 1" followed by "start animation". I also have a crouching animation, but it only plays the first frame out of two frames no matter what I do.

    My last problem is that the character will run into a "wall" which is declared as a solid, yet the character will magically "jump" to the top of the wall or even stick to the sides half way up/down the wall... even if I change the collision mode for the player to bounding box (which I don't really want anyway). I fixed that by making an event "if player collides with wall">"player stop" but this creates undesired results depending on the current animation frame of the player if they are running.

    PLATFORM MOVEMENT IS MAKING ME GO CRAZY! PLX HALP!

    I will happily post my cap in here if there are any takers... meawhile I keep ripping my hair out.

    ~Sol

  • My last problem is that the character will run into a "wall" which is declared as a solid, yet the character will magically "jump" to the top of the wall or even stick to the sides half way up/down the wall... even if I change the collision mode for the player to bounding box (which I don't really want anyway). I fixed that by making an event "if player collides with wall">"player stop" but this creates undesired results depending on the current animation frame of the player if they are running.

    This happens when your animation frames aren't a consistent size (which is almost always when it comes to animation). What's happening is that on one frame your animation might be 20px wide, then your character hits a wall. The next frame is then a pixel or few wider, which means your character is now intersecting the wall.

    The platform behavior automatically pushes sprites up when they're stuck like this. This is necessary for gravity to work... when a sprite is falling, the platform engine checks for intersection, and if there is, it runs a quick loop to jump the player to the top of whatever it's intersecting.

    The way to work around it is to make a separate sprite for the player that is a constant size. A one-frame, one direction, single-animation, perfectly rectangular bounding box. The bounding box is what you apply the platform behavior to. Then you make it invisible and overlay your animation frames on top of it.

    It's best to make your bounding box a sort of "average" size for your sprite, something that covers the main torso/head and goes straight down to the floor from there, so that extremities don't get in the way. If you need pixel-perfect collision for enemies or bullets or whatever, you could always use the player sprite to check for that (though I wouldn't recommend it for Mario type games).

    Anyway, with a Flashback type engine you might want to avoid using the Platform behavior altogether. I know it would be a lot of work (one reason why mine is on hold) but it's such a unique type of platforming that trying to recreate it with the Platform behavior is probably a lost cause. Things like running and jumping aren't so much about moving the player sprite in x/y over time as it is about playing a specific number of animation frames to get from point a to point b. In Flashback all movement is very pixel-precise... the player's feet always land in the same place, he always jumps the same height/distance, and he's always lined up exactly with platforms when you stop, etc. The Platform behavior in contrast is very loose and sloppy in that regard. Trying to whip it into shape would be a lot of work, and you'll likely go completely insane from it.

    As for the animations stopping, go ahead and post your .cap or PM me and I'll take a look at it.

    Sorry for the WALL OF TEXT but hey, that's my style

  • Cheers for the detailed reply mate.

    Ironically, I ended up making a separate object as you suggested... before you posted that! Haha. It seems to work a lot better now with the wall collision thing... in fact, I'm pretty damn happy with it now in general apart from the animations not working right.

    For some reason, if I change "repeat to frame" to ANYTHING, it just defaults back to "1" if I click on something else and come back and check. The only way I could fix the jumping animation problem was to turn off "loop" and set the animation to repeat twice. You only see it once because of the height the character can jump, unless you jump down a large "hole" or whatever... then it repeats twice, but keeps the other animations from locking up.

    I still can't get crouching to play all of the animation frames. It either plays just frame 1 and stops there (but doesn't cause any other animations to freeze up), or it jumps right to frame 2 and stops there instead (again no freezing other animations). The quick solution is to just turf the first animation frame and use a single frame for ducking... but I want two frames simply because IT WON'T F'ING LET ME!

    I want to play with it a tad more myself before I upload it, in case I did something super dopey... but I would expect to see it up here in the next couple of hours haha.

    Cheers again for your help!

    ~Sol

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think David found some bugs in the animation system (including looping) which ought to be fixed for the next build... also, I'm not convinced the platform movement should push-up when the object intersects a solid - it was probably done quickly a while ago to fix some hanging bugs. I guess ideally it should push-out in the direction it came from.

  • I think David found some bugs in the animation system (including looping) which ought to be fixed for the next build... also, I'm not convinced the platform movement should push-up when the object intersects a solid - it was probably done quickly a while ago to fix some hanging bugs. I guess ideally it should push-out in the direction it came from.

    One other request I have is, if a platform object collides with a "wall" for example... can you add something in there that can make the animation "stop" instead of insisting on playing? For example my characters running animation will continue to try and play if I keep trying to run into a wall, though it seems to slow the animation down to super slow. It would be nice if we could select a default animation sequence on colliding with a wall... I tried setting the animation to something else, and that seemed to "lock up" other animations yet again.

    ~Sol

  • One other request I have is, if a platform object collides with a "wall" for example... can you add something in there that can make the animation "stop" instead of insisting on playing?l

    Heh, I'm going to cover this in my tutorial, under the intro to detectors

    If you have left/right detectors attached to your platform object then you can shut off the animation when one is intersecting the wall.

    Alternately, if you don't want to use detectors, you could do it by checking if the x coordinate is the same as it was the previous frame. So like, if the player is pushing the run key but the character isn't moving... well, you get the idea

  • I am such a focking noob when it comes to platform games D:

    I'm glad you are here to save me deadeye! xD

    ~Sol

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)