Player stays in running animation when falling

Post Reply
User avatar
CutterCross
Posts: 271
Joined: Sat Apr 28, 2018 9:42 pm

Player stays in running animation when falling

Post by CutterCross » Sat Sep 01, 2018 11:46 pm

Whenever you run off an edge, the player stays in it's running animation while it's falling. I've been trying to fix this myself but with no luck. Anyone else know a way to fix it?
The Tower of Turmoil: viewtopic.php?f=12&t=1348
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Player stays in running animation when falling

Post by WolfMerrik » Sun Sep 02, 2018 12:27 am

You could create a state for falling (or use jumping) and set it to the player when the ground below is not solid
I would assume the best place for this would be in the theGroundIsNotSolid: on AccAndSpeed_Platform_Simple.asm (or whichever AccAndSpeed you are using)
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
cornphillips
Posts: 28
Joined: Wed Aug 15, 2018 5:01 am

Re: Player stays in running animation when falling

Post by cornphillips » Mon Sep 03, 2018 3:36 am

I've also found that if i jump up one and to the right tile onto another block, and my jump is only big enough to make it up that amount, then the animation gets stuck on the first fame while running right, but it doesn't happen when doing the same thing going left.
User avatar
drdocker
Posts: 15
Joined: Mon Nov 12, 2018 6:27 am
Location: Seattle

Re: Player stays in running animation when falling

Post by drdocker » Mon Nov 19, 2018 6:19 pm

WolfMerrik wrote:
Sun Sep 02, 2018 12:27 am
You could create a state for falling (or use jumping) and set it to the player when the ground below is not solid
I would assume the best place for this would be in the theGroundIsNotSolid: on AccAndSpeed_Platform_Simple.asm (or whichever AccAndSpeed you are using)
Thanks for pointing this out! If anyone else is interested in adding a falling state I added it to Physics_Platform_Simple.asm under theGroundIsNotSolid2_b: label at line 790

Code: Select all

theGroundIsNotSolid2_b:
LDX player1_object
    ; change player to falling/ jumping state
	ChangeObjectState #$02, #$02
	JMP noCollisionHere_v
@ WolrMerrik do you know how I would check the player's current state? I only want to change it to falling if it's currently in the idle (0) or running (1) state.
User avatar
drdocker
Posts: 15
Joined: Mon Nov 12, 2018 6:27 am
Location: Seattle

Re: Player stays in running animation when falling

Post by drdocker » Thu Nov 22, 2018 2:19 pm

Actually, @MistSonata pointed out a solution in a similar thread here viewtopic.php?f=23&t=1314
Post Reply