feat: render "shadow"

main
Louis Pearson 2024-04-19 09:07:20 -06:00
parent 2ab9a1f3a0
commit 40c151a86b
1 changed files with 25 additions and 19 deletions

View File

@ -42,10 +42,6 @@ WaitVBlank:
call Memcopy
; Reset positions
ld hl, wSimplePosition
ld a, 8
ld [hl], a
ld hl, wMetaspritePosition.x
ld a, 0
ld [wMetaspritePosition.x], a
@ -168,7 +164,7 @@ Main:
ld c, a
ld [wMetaspritePosition.z+1], a
.jumpend
.jumpend:
ld a, [wJoypadState]
bit PADB_B, a
@ -184,7 +180,7 @@ Main:
ld [wMetaspritePosition.z], a
jr .fallend
.fall
.fall:
ld a, [wMetaspritePosition.z]
sub a, 16
ld b, a
@ -193,16 +189,9 @@ Main:
sbc 0
ld c, a
ld [wMetaspritePosition.z+1], a
.fallend
ld de, $0100
ld c, 8
ld b, 16
call RenderSimpleSprite
ld hl, wSimplePosition
inc [hl]
.fallend:
; Render the player
; load de
ld a, [wMetaspritePosition.x]
ld e, a
@ -224,6 +213,23 @@ Main:
ld hl, CatMetasprite
call RenderMetasprite
; Render the shadow
; load de
ld a, [wMetaspritePosition.x]
ld e, a
ld a, [wMetaspritePosition.x + 1]
ld d, a
; load bc
ld a, [wMetaspritePosition.y]
ld c, a
ld a, [wMetaspritePosition.y + 1]
ld b, a
ld hl, ShadowMetasprite
call RenderMetasprite
ldh a, [hFrameCounter]
inc a
ldh [hFrameCounter], a
@ -431,11 +437,11 @@ CatMetasprite:
db 24, 12, 0, 0
db 128
SECTION "Position Vars", WRAM0
; 8-bit X position
wSimplePosition:
ds 1
ShadowMetasprite:
db 24, 12, 0, 0
db 128
SECTION "Position Vars", WRAM0
; Q12.4 fixed-point X posiition
wMetaspritePosition:
.x: