Problem with animation on moving platform

0 favourites
  • 9 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • Hi everyone,

    I've been evaluating the free version of construct 2 and so far I'm very impressed. I've been making a very simple test of a platform game and I'm surprised how easy and intuitive it has been. I've got a problem that I can't understand though..

    I have a platform character and I've managed to get all the animations working how I want them to, running/jumping falling etc. The movement of the character was quite choppy though so I changed the platform movement to an invisible rectangle as I read on a forum, which has improved the motion a lot. But for some reason my character doesn't interact with moving blocks well.   When he stands on top of one and the block is moving down, he flickers between a falling and standing state, when obviously he should just be in a standing state. also sometimes he doesn't land on the block but falls straight through it.

    could someone point me in the right direction?

    here's the file: dl.dropbox.com/u/54003328/Test.capx

    cheers

  • Just off the top of my head: i believe you'll overcome that problem by pinning the player sprite to the moving block, then unpinning the player when it's time to move. Here is an example of when I'm talking about. Hope this helps!

  • thanks for the response. I think I understand the theory behind what you're suggesting but I'm not quite sure how to implement it. I tried a few things with 'pin' but I don't really know what I'm doing..

  • Have you looked at the pin behavior example in your c2 install\examples folder ?

    It explains the basic of the pin behavior.

  • OK I had a look and now I understand what the pin does, thanks. I had another play with my game, trying to pin the character to the top of the moving platform when he is stopped on it, but the results weren't that great. Although he is now moving with the platform and not 'falling' with the platform, the movement is not smooth and his feet keep moving in and out of the block.. I wasn't really sure how to describe when the player was on top of the block.. I used 'collision with' and .Y being less than the top of the block. Not sure this is the best approach though.. anyone any suggestions?

  • I wonder if THIS SOLUTION from ROJOhound may be of use. Although not quite the same situation as the original thread, the theory of adjusting the sprite to the movement may also work in this instance.

    Worth a try, perhaps.

  • thanks for the responses but I still can't figure out a way of making this work and look good. I tried the solution by ROJOhound but it didn't really give a satisfactory result. With the other method I can force the player to stay pinned to the platform but it doesn't look smooth. It seems that the problem is fundemental to the interaction between the player and the sin behavior of the moving block. If you pin them together you can see the character 'bobble' as the two objects move in and out of each other a little every frame. I'm a bit surprised that two of the basic behaviours don't interact better with each other...? Am I using this in an unconventional way or something?? I guess I'll have to abandon using moving blocks in my game unless there are any other ideas..

  • best I can do verticalMovingPlatforms.capx

    few comments in the capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks Yann, that's really good! <img src="smileys/smiley4.gif" border="0" align="middle" />   Took me a while to understand the changes but I think I get what you've done now. It's not perfect but it's pretty close! and not noticeable unless you're actively looking for it I think. Thanks again for your help.

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