mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-08-07 16:25:16 +00:00
peasant: falling animations closer to good
This commit is contained in:
@@ -63,6 +63,22 @@ done_draw_peasant:
|
|||||||
|
|
||||||
draw_peasant_falling:
|
draw_peasant_falling:
|
||||||
|
|
||||||
|
; PEASANT_FALLING already in A here
|
||||||
|
; 1 = falling
|
||||||
|
; 2 = crashing
|
||||||
|
; 3 = crashed
|
||||||
|
|
||||||
|
cmp #2
|
||||||
|
bcc yep_really_falling ; blt
|
||||||
|
|
||||||
|
lda #(32-1) ; base splat sprite
|
||||||
|
clc ; -1 as we are 1/2 here
|
||||||
|
adc PEASANT_FALLING
|
||||||
|
bne yep_falling_common ; bra
|
||||||
|
|
||||||
|
|
||||||
|
yep_really_falling:
|
||||||
|
|
||||||
; get offset for graphics
|
; get offset for graphics
|
||||||
|
|
||||||
lda FRAME ; always spinning, spinning
|
lda FRAME ; always spinning, spinning
|
||||||
@@ -70,9 +86,7 @@ draw_peasant_falling:
|
|||||||
clc
|
clc
|
||||||
adc #28 ; peasant fall offset
|
adc #28 ; peasant fall offset
|
||||||
|
|
||||||
; lda #28 ; peasant fall offset
|
yep_falling_common:
|
||||||
; clc
|
|
||||||
; adc CLIMB_COUNT
|
|
||||||
tax
|
tax
|
||||||
|
|
||||||
ldy #4 ; reserved for peasant
|
ldy #4 ; reserved for peasant
|
||||||
@@ -85,7 +99,23 @@ draw_peasant_falling:
|
|||||||
|
|
||||||
lda PEASANT_X
|
lda PEASANT_X
|
||||||
sta CURSOR_X
|
sta CURSOR_X
|
||||||
lda PEASANT_Y
|
|
||||||
|
lda PEASANT_FALLING ; if falling, adjust from table
|
||||||
|
cmp #1
|
||||||
|
beq flame_adjust_falling
|
||||||
|
|
||||||
|
; otherwise, always adjust as if it's 1
|
||||||
|
ldx #1
|
||||||
|
bne flame_adjust_mid ; bra
|
||||||
|
|
||||||
|
flame_adjust_falling:
|
||||||
|
lda FRAME
|
||||||
|
and #3
|
||||||
|
tax
|
||||||
|
flame_adjust_mid:
|
||||||
|
lda peasant_flame_fall_yadjust,X
|
||||||
|
clc
|
||||||
|
adc PEASANT_Y
|
||||||
sec
|
sec
|
||||||
sbc #4
|
sbc #4
|
||||||
sta CURSOR_Y
|
sta CURSOR_Y
|
||||||
@@ -116,6 +146,9 @@ peasant_flame_offsets:
|
|||||||
; .byte 22,16,19,25
|
; .byte 22,16,19,25
|
||||||
.byte 25,16,19,25
|
.byte 25,16,19,25
|
||||||
|
|
||||||
|
; head at different heights so move flame with it
|
||||||
|
peasant_flame_fall_yadjust:
|
||||||
|
.byte 11,16,16,0
|
||||||
|
|
||||||
; note: animation actually 5 frames
|
; note: animation actually 5 frames
|
||||||
; essentially counts down 3,2,1,0 then 0 again
|
; essentially counts down 3,2,1,0 then 0 again
|
||||||
|
@@ -12,15 +12,38 @@ move_peasant:
|
|||||||
|
|
||||||
|
|
||||||
peasant_falling:
|
peasant_falling:
|
||||||
|
; if PEASANT_FALLING == 1, then falling
|
||||||
|
; if PEASANT_FALLING == 2, then crashing
|
||||||
|
; if PEASANT_FALLING == 3, then crashed
|
||||||
|
|
||||||
|
|
||||||
|
lda PEASANT_FALLING
|
||||||
|
cmp #2
|
||||||
|
bcs done_falling_peasant ; bge
|
||||||
|
|
||||||
|
|
||||||
; restore bg behind peasant
|
; restore bg behind peasant
|
||||||
|
|
||||||
jsr erase_peasant
|
jsr erase_peasant
|
||||||
|
|
||||||
lda PEASANT_Y
|
|
||||||
cmp #140
|
|
||||||
bcs done_falling_peasant
|
|
||||||
|
|
||||||
|
; FIXME: if not on screen0
|
||||||
|
|
||||||
|
lda PEASANT_Y
|
||||||
|
cmp #115
|
||||||
|
|
||||||
|
bcc move_falling_peasant
|
||||||
|
|
||||||
|
; if here, finish falling
|
||||||
|
|
||||||
|
inc PEASANT_FALLING
|
||||||
|
jmp done_falling_peasant
|
||||||
|
|
||||||
|
|
||||||
|
move_falling_peasant:
|
||||||
inc PEASANT_Y
|
inc PEASANT_Y
|
||||||
|
inc PEASANT_Y
|
||||||
|
|
||||||
done_falling_peasant:
|
done_falling_peasant:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user