Problem with animation on moving platform

Get help using Construct 2

Post » Tue Dec 20, 2011 10:38 am

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: http://dl.dropbox.com/u/54003328/Test.capx

cheers
B
3
G
1
Posts: 5
Reputation: 485

Post » Tue Dec 20, 2011 10:51 am

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!
B
27
S
5
G
5
Posts: 24
Reputation: 4,553

Post » Tue Dec 20, 2011 12:51 pm

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..
B
3
G
1
Posts: 5
Reputation: 485

Post » Tue Dec 20, 2011 1:29 pm

Have you looked at the pin behavior example in your c2 install\examples folder ?
It explains the basic of the pin behavior.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Dec 20, 2011 2:37 pm

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?
B
3
G
1
Posts: 5
Reputation: 485

Post » Tue Dec 20, 2011 8:34 pm

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.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,840
Reputation: 48,281

Post » Wed Dec 21, 2011 5:36 pm

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..
B
3
G
1
Posts: 5
Reputation: 485

Post » Wed Dec 21, 2011 6:29 pm

best I can do verticalMovingPlatforms.capx
few comments in the capx
Last edited by Yann on Sun Sep 14, 2014 10:44 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Dec 21, 2011 6:47 pm

thanks Yann, that's really good!    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.
B
3
G
1
Posts: 5
Reputation: 485


Return to How do I....?

Who is online

Users browsing this forum: GUN, MrLOL64 and 13 guests