I'm using the PMO and have all my animations working (pretty much), but the Jumping and Falling animations are messing me around. Basically, the falling animation will only play when the character is falling AND moving either left or right. If I stand still and jump, the animation sticks on the first frame, refusing to play the rest.
First off, do you have events to handle the animations?
(i.e. if pmo is falling, then play falling animation)
Check the events for your idle animation, for instance, if you have it set to "Player is not moving left or right" and nothing else, it will always play the idle animation if the character isn't moving, even if they're jumping.
With the animation sticking, it might be because it keeps being told to play, instead of saying "Player is jumping, play jump animation" say "Player is jumping and jump animation isn't playing, play jump animation".
But of course, I'd know for sure if you posted an .mfa of the problem area.
Well, this happens with the PMO every time I use it. I get all the regular animations working like so:
IF object is not moving
THEN play stopped animation
IF object is moving
THEN play walking animation
IF object is jumping
THEN play jumping animation
IF object is falling
THEN play falling animation
They all work, except the falling animation. It only works if I'm moving left or right, otherwise it's just one frame. It's always been this way for me, if you make a little test you should get the same problem... :/
Thanks for the reply. I'm not on Windows right now so I can't test it right now. I've looked at the changes you've suggested but am not sure you understand what the problem is.
All my animations work fine. Even the falling animation plays. But it only plays the falling animation if the player is moving left or right at the same time. This sounds strange, and it is. If I simply press jump without moving left or right, the falling animation will play just the first frame and stick on it until it lands, and not the full animation.
That's because according to the PMO, "when the object is not moving" simply means pressing the left or right buttons, jumping or falling does not count as moving. When you are jumping and not moving, it still considers that not moving above all, so it is going back and fourth between running the idle animation and the jump/fall animation.
Each tick (since the idle code is above the jump code) it changes the animation to idle, then in the same tick it changes the animation back to jump/falling, visually you will not see the change, but in code it happens. For whatever reason these same rules do not apply to the "when the object IS moving code".
Looking over the code I've done using the PMO, I shy away from using the object is moving/object is not moving lines, I usually write them as
PMO Object is standing on ground
Left key is not pressed
Right key is not pressed
-Play idle animation
PMO Object is standing on ground
Left key is pressed
-Play walking animation
PMO Object is standing on ground
Right key is pressed
-Play walking animation
Thanks Oh hey, Chloe! You'll have to forgive me as my mind actually starts hurting when I have to think even slightly technically. I have a lot going on in my events now so it'll take me a while to think properly about what's going where but I think I know what you mean now.
I don't use the built-in movement because the player will get stuck in the ceiling if you down the hold jump button, and more annoying than that, if you're holding right and try to jump over an obstacle, the player will just jump up as if you're not pressing right.
Because I try to avoid being too technical where possible, I can't make my own movement. So the PMO seems alright for me.
AndyUK - ive both created my own movement/collision engines and used PMO and to be honest i found the PMO gave great results with a fraction of the work, Its great if your not doing anything really strange with your game but you can make it do pretty much everything you would expect from platform games, wall jumps, wall slides, double jumps. I even had a little engine going where you could jump and ground slam (like mario) and it would smash holes in the ground.
Ive never really tried it with realistic physics though so dont know how it holds up there.
I would def use it again if i was to make (and finish) a platform game.
I use pmo any time i make a platformer. it does pretty much anything you could want in a platformer and it keeps it simple. the engine im working on uses the pmo, it has a dash, double jump, wall jump, wall slide and such. also... default movement is terrible. id rather make my own than use the default.
[Game design makes my brain feel like its gonna explode.]