Sliding problems....

0 favourites
  • 4 posts
  • Howdy yall...

    I just started messing around with construct 2 and I'm really impressed so far with how easy it is to learn. However, I've sorta run into a snag, I was working on the tutorial and around page 6 I ran into a problem. Not so much with the tutorial but with my animations.

    So this is the pickle of my dilemma:

    The animation deviate from the tutorial in the following. I have a idle, idle to jump, fall, and landing animation (that is an animation that moves from fall to idle).

    what is messing with my strudel is the fact that the animation wont go through completely. I can go from idle to jump and running to jump no problem. However, on the flip side, I can only go from fall to idle, not fall to run. That is if I press the right or left arrow while jumping and hold it...instead of going straight to the run animation when the sprite touches the floor, it locks up and stays on the fall anim. I've tried several things, as well as inverting some events but I still get the snag.

    Right now what i got is:

    <img src="http://i267.photobucket.com/albums/ii287/Brick_KingofHearts/prob_zps13e3fb40.jpg" border="0" />

    so...any ideas?

  • One thing i see off the top is your last action ...

    Platform on landed (platform is not moving)

    In one tick you are asking it to start the "Land" animation" then immediately play the "Idle" animation

    that's not going to play them back to back as you would hope they would.

    You could add a sub event and put "on animation finished" action instead, then it will play one then the other.

    Right now they are stepping on each other and you probably won't ever see it play the "land" animation

    its also getting overwritten again when you use the "on any animation finished" -> player set "runloop" action earlier.

    One way to setup an animation system like this is to create a 2 global variables such as "CurrentAnimationState" and "PreviousAnimationState"

    Then create a series of scenarios that change the animation based on whatever your current and previous state of the player's animation was in.

    eg: when the player is running (on key right), you set "CurrentAnimationState" to "Running" and "PreviousAnimationState" to "Idle"

    Then create a "check" that says If CurrentAnimationState ="Running AND "PreviousAnimationState = "Idle" -> Play animation "StartRunningFromStop"

    Next you would create another check (on key right released) that says "If CurrentAnimationState" = "Running" AND "no key is being pressed" -> Player "RunningtoStop" animation

    Then create several of these "checks" for every possible combination of types of animations you want to have in your game.

    Each variation will be separate actions which makes debugging and tweaking much easier (although you end up with a lot more events) But the tradeoff is much easier to visualize and wrap your head around in more complex games.

    Basically right now you just have several platform movements all firing off at the same time stepping on each other.

    If you post the .capx file in dropbox or a similar service and post it for us we can tweak the file and show you how to fix it.

  • Thank you for the quick reply and I would love any help you could give...so here is the capx file.

    if its alright...while you look at it, im going to try and see if I can set it up the way you mentioned.

    docs.google.com/file/d/0BzSiRTsDuTgbSlhMUmRGLWEzRGc/edit

    *edit* oh...one more thing...I my file crashed before i could save it so this is the new build...came out better i think...same problem though.

    *EDIT NUMBER 2*

    SUCCESS....I think i did what you said. What i did is i created an even with the following conditions (i hope thats the correct term)

    If PlayerCtrl has landed and the current animation is "fall" and the Right Arrow is down Then set PlayerSkin to "run".

    So i made two...one for the when the Right arrow is being pressed and one for when the Left arrow is being pressed. This is what you mean by checking the conditions right?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So here is a picture of the fix for both landing facing right and left, and even idle.

    <img src="http://i267.photobucket.com/albums/ii287/Brick_KingofHearts/crud/Fixed_zpsc68f94ff.jpg" border="0" />

    and here is the X-file. (forgive the pun)

    docs.google.com/file/d/0BzSiRTsDuTgbRThFbEtPRWxmOGc/edit

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