chronicleroflegends
Member
Hey guys, I am working on some modifications to make the 'skip top collision' work with tiles as well.
This would let the player/enemies that have a ducking animation pass under tiles while ducked but collide with them while standing.
I almost have it working, but I am having a bit of a glitch I am having trouble cleaning up.
Of course, when I get this working, I plan to share how to do it all.
I have attached a gif of the problem I am having.
So, the player can pass under objects while in the ducked/crouched state with no issue. The problem occurs if the player stands back up while they are under the object.
What I want to happen, is to prevent the player from transitioning back to their idle state if their top collision points are colliding with a tile.
Pseudocode:
(In extra contol reads, where I have the rest of my code that forces states)
Should we transition to idle state?
=Are we in crouched or slide state?
==Yes:
===Is there a tile above the crouched player?
====Yes:
=====Force the player into the crouched position, they can move L/R but not stand up.
====No:
=====Transition to idle
==No:
===Transition to idle
How I am trying to do this, is to use a bit of code from a tile collision macro, CheckForVertical Ejection.
I copy/pasted it and changed subroutine call to push the player down to change the players object state to crouched:
However, this doesn't seem to be working :\ The player can still stand up while under the tiles.
This would let the player/enemies that have a ducking animation pass under tiles while ducked but collide with them while standing.
I almost have it working, but I am having a bit of a glitch I am having trouble cleaning up.
Of course, when I get this working, I plan to share how to do it all.
I have attached a gif of the problem I am having.
So, the player can pass under objects while in the ducked/crouched state with no issue. The problem occurs if the player stands back up while they are under the object.
What I want to happen, is to prevent the player from transitioning back to their idle state if their top collision points are colliding with a tile.
Pseudocode:
(In extra contol reads, where I have the rest of my code that forces states)
Should we transition to idle state?
=Are we in crouched or slide state?
==Yes:
===Is there a tile above the crouched player?
====Yes:
=====Force the player into the crouched position, they can move L/R but not stand up.
====No:
=====Transition to idle
==No:
===Transition to idle
How I am trying to do this, is to use a bit of code from a tile collision macro, CheckForVertical Ejection.
I copy/pasted it and changed subroutine call to push the player down to change the players object state to crouched:
Code:
notDoingAnything:
LDA gamepad
AND #%11110000 ;We ARE doing something, so skip change to idle and wait for next check.
BEQ +
JMP skipMainGameExtraInputControl
+:
GetCurrentActionType player1_object ; check current state
BEQ skipMainGameExtraInputControl ; if already 0, don't change it again.
;; If we were shooting dont interrupt
LDA temp
CMP #$05
BEQ skipMainGameExtraInputControl
;; If we are ducking, check if we are in a tunnel, if so, force crouch.
LDA temp
CMP #$03
BNE ++
;; Check if in tunnel
LDA #$00
STA tile_solidity
LDA Object_x_hi,x
CLC
ADC Object_left,x
STA tileX
LDA #$00
BCC +
LDA #$01
+:
STA tempCol
LDA yHold_hi
CLC
ADC Object_top,x
STA tileY
JSR GetTileAtPosition
JSR DetermineCollisionTable
STA collisionPoint0 ;; comment this out?
JSR CheckForCollision
LDA tile_solidity
AND #%00000001
BEQ +
ChangeObjectState #$03, #$04
JMP skipMainGameExtraInputControl
+:
++:
ChangeObjectState #$00, #$04
skipMainGameExtraInputControl:
RTS
However, this doesn't seem to be working :\ The player can still stand up while under the tiles.