Test updating tile ID in UpdateSprite for a run sequence.

This commit is contained in:
Lucas Scharenbroich 2021-11-20 20:33:27 -06:00
parent 9b5d3da0e4
commit 90267e4646
2 changed files with 23 additions and 8 deletions

View File

@ -411,8 +411,6 @@ UpdatePlayerLocal
; Simple updates with gravity and collisions. It's important that eveything in this
; subroutine be done against
UpdatePlayerPos
stz tmp0 ; build up some flags
stz PlayerStanding
lda PlayerYVel
bmi :no_ground_check
@ -490,13 +488,32 @@ UpdatePlayerPos
txa
ora LastHFlip
ora #SPRITE_ID
tax
sta SpriteFrame
; If the player is standing and XVel != 0, pick a frame
lda PlayerStanding
beq :frame
lda PlayerXVel
beq :frame
jsl GetVBLTicks
and #$0003
inc
and #$0003
asl
adc SpriteFrame
sta SpriteFrame
:frame
ldx SpriteFrame
lda PlayerID
jsl UpdateSprite ; Change the tile ID and / or flags
rts
LastHFlip dw 0
SpriteFrame ds 2
; X = coordinate
; Y = coordinate
GetTileAt

View File

@ -78,9 +78,7 @@ _Render
jsr _ApplyBG0XPosPre
jsr _ApplyBG1XPosPre
nop
jsr _RenderSprites ; Once the BG0 X and Y positions are committed, update sprite data
nop
jsr _UpdateBG0TileMap ; and the tile maps. These subroutines build up a list of tiles
jsr _UpdateBG1TileMap ; that need to be updated in the code field
@ -122,9 +120,9 @@ _Render
ldy ScreenHeight
jsr _BltRange
ldx #0
ldy ScreenHeight
jsr _BltSCB
; ldx #0
; ldy ScreenHeight
; jsr _BltSCB
lda StartY ; Restore the fields back to their original state
ldx ScreenHeight