Flickering between animations

Get help using Construct 2

Post » Tue Sep 06, 2016 5:57 am

Hey, I'm playing around with a platformer and when my player lands on a platform it flickers between the falling animation and the idle animation. Here is my event logic:

Image

Its probably obvious to you guys, but I am a little confused here.

Thanks in advance.
B
5
S
1
Posts: 13
Reputation: 351

Post » Tue Sep 06, 2016 7:54 am

From where you set all your animations, can you try add "else" to the second and third subblock at event 11 and 12 respectively? Is the flicker still present? Is there anywhere else you are setting animation?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Tue Sep 06, 2016 8:36 am

Done, here is the new event list, however the same thing still happens :/
Image
B
5
S
1
Posts: 13
Reputation: 351

Post » Tue Sep 06, 2016 8:41 am

Do all those animations have the same hitbox size for all frames? Where are their hotspots? Show them all.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Tue Sep 06, 2016 8:54 am

It is likely indeed the collision box issue.
If between a frame and another of the idle animation the collision box is smaller, Construct will consider for a few tick that the object is falling, and will switch to the "Falling" animation.

Once on the Falling animation, if all the hitboxes are the same appropriate size and close enough to the ground, then Construct will consider the object has landed and is on the floor, and will switch again to the "Idle" animation.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Tue Sep 06, 2016 9:05 am

Okay so each frame is 96x96 in size, (a large buffer window since i'm not rendering large weapons) They are all centred at the bottom of this graphic like so. The hitboxes are like so:

Idle:
Image

Falling:
Image

The head positions are a little different however the base hitbox is always the bottom of the graphic. (The 96th pixel)

Edit: Just realised I messed up the cropping of the 1st image at the top, my bad.
B
5
S
1
Posts: 13
Reputation: 351

Post » Tue Sep 06, 2016 9:10 am

Don't use a single pixel on the ground, prefer to have at least two that will make a proper line.
Then, make sure the alignement/distance between the origin point and this "ground" is the same on all frames.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Tue Sep 06, 2016 9:36 am

Right, I was thinking it was a little funny, I was basing it off the "guess polygon shape" feature and I assumed that was the way to do it. However its still doing it with the improved hitboxes:

Idle:
Image

Falling:
Image
B
5
S
1
Posts: 13
Reputation: 351

Post » Tue Sep 06, 2016 9:54 am

Make sure the origin point is placed at the same position on each frame.
Otherwise post your complete capx so we can investigate further.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Tue Sep 06, 2016 11:39 am

I think event 10 should be 'on jump'. As a top level event, no sub.

12 should be (no sub)
Is on the floor
Is moving

or

is on the floor
compare two values ... abs(sprite.flatform.VectorX) .. > ... 1 (rather this)

13 should be (again no sub)

Is on platform
compare two values ... abs(sprite.flatform.VectorX) .. <= ... 1 (rather this)
Because jumping/falling/landing = moving

Look a second at my example in here
viewtopic.php?f=147&t=181421&p=1065860#p1065860
B
33
S
18
G
27
Posts: 2,430
Reputation: 20,324

Next

Return to How do I....?

Who is online

Users browsing this forum: mrkaio, muquia, tarek2 and 2 guests