Animations

For questions about using Classic.

Post » Fri Sep 19, 2008 6:36 am

If you don't loop the animation then it stops when it gets to the end. That's how it works.

It makes sense if you think about it.

If you don't want to have to bother with "Play animation" actions, then just check Loop, and set the Repeat To box to the last frame. You're still going to have to Set Frame to 1 if you ever want to play it from the beginning though.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Sep 19, 2008 11:57 am

Yeah you're right. n_n
It does seem like they've done this sensibly :wink: , I guess I'm just use to MMF's simplicity :oops: .
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Fri Sep 19, 2008 2:58 pm

[quote="alspal":25na3y32] I guess I'm just use to MMF's simplicity :oops: .[/quote:25na3y32]
BAD HABITS dont worry happends all the time, like when learning C++ from Pascal.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Sat Sep 20, 2008 4:46 am

Deadeye, you should make a template thing so that people can understand how to use animations? :D
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat Sep 20, 2008 5:24 am

I've been thinking about making a series of beginner tutorials, but the problem is I'm so very, very lazy.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Sep 29, 2008 12:14 pm

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
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Sep 29, 2008 2:29 pm

[quote="SoldjahBoy":15s5o9q8]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.[/quote:15s5o9q8]

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 ;)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Sep 30, 2008 12:11 am

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
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Tue Sep 30, 2008 10:26 am

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Tue Sep 30, 2008 10:52 am

[quote="Ashley":3i3gedbu]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.[/quote:3i3gedbu]

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
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest