added second animation

This commit is contained in:
Thorn Avery 2020-05-29 14:09:57 +12:00
parent 52492799db
commit 5a14e2f17f
6 changed files with 130 additions and 14 deletions

32
ass/villager.ass Normal file
View File

@ -0,0 +1,32 @@
SECTION "VillagerWaving", ROM0
VillagerTiles::
DB $1F,$18,$3F,$20,$7F,$48,$74,$57
DB $26,$25,$0E,$09,$0E,$0A,$1E,$12
DB $F8,$18,$FC,$04,$FE,$12,$2E,$EA
DB $64,$A4,$70,$90,$70,$50,$78,$48
DB $0F,$08,$1F,$12,$1D,$14,$1F,$10
DB $0F,$09,$07,$04,$03,$02,$07,$04
DB $F0,$10,$F8,$48,$B8,$28,$F8,$08
DB $F0,$90,$E0,$20,$C0,$40,$E0,$20
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$03,$02,$03,$02,$07,$04
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $80,$80,$C0,$40,$C0,$40,$E0,$20
DB $0F,$08,$1F,$10,$1F,$12,$1D,$14
DB $0F,$08,$07,$05,$03,$02,$07,$04
DB $F0,$10,$F8,$08,$F8,$48,$B8,$28
DB $F0,$10,$E0,$A0,$C0,$40,$E0,$20
DB $07,$04,$1F,$18,$3F,$20,$7C,$4F
DB $76,$55,$2E,$29,$0E,$0A,$1E,$12
DB $E0,$20,$F8,$18,$FC,$04,$3E,$F2
DB $6E,$AA,$74,$94,$70,$50,$78,$48
DB $0F,$08,$1F,$12,$1D,$14,$1F,$10
DB $0F,$09,$07,$04,$03,$02,$1F,$1C
DB $F0,$10,$F8,$48,$B8,$28,$F8,$08
DB $F0,$90,$E0,$20,$C0,$40,$F8,$38
DB $3F,$20,$7F,$48,$77,$54,$24,$27
DB $06,$05,$0E,$09,$0E,$0A,$1E,$12
DB $FC,$04,$FE,$12,$EE,$2A,$24,$E4
DB $60,$A0,$70,$90,$70,$50,$78,$48
VillagerTilesEnd::

BIN
ass/villager.gbr Normal file

Binary file not shown.

View File

@ -7,6 +7,7 @@ SECTION "Actor", ROM0
ActorROM::
.structs:
dw ActorIdle
dw VillagerWaving
ActorIdle::
db 60
db 15
@ -48,3 +49,77 @@ ActorIdle::
db 0, -8, 15, 0
db 0, 0, 16, 0
.frameVoEnd
VillagerWaving::
db 90
db 15
dw .vwFrame01
db 15
dw .vwFrame02
db 15
dw .vwFrame03
db 15
dw .vwFrame04
db 15
dw .vwFrame05
db 15
dw .vwFrame06
.vwFrame01
db (.vwFrame01End - @) / 4
db 8, -16, 17, 0
db 8, -8, 18, 0
db 0, -16, 19, 0
db 0, -8, 20, 0
db -8, -16, 21, 0
db -8, -8, 22, 0
.vwFrame01End
.vwFrame02
db (.vwFrame02End - @) / 4
db 8, -16, 17, 0
db 8, -8, 18, 0
db 0, -16, 23, 0
db 0, -8, 24, 0
db -8, -16, 21, 0
db -8, -8, 22, 0
.vwFrame02End
.vwFrame03
db (.vwFrame03End - @) / 4
db 8, -16, 25, 0
db 8, -8, 26, 0
db 0, -16, 23, 0
db 0, -8, 24, 0
db -8, -16, 21, 0
db -8, -8, 22, 0
.vwFrame03End
.vwFrame04
db (.vwFrame04End - @) / 4
db 8, -16, 17, 0
db 8, -8, 18, 0
db 0, -16, 23, 0
db 0, -8, 24, 0
db -8, -16, 21, 0
db -8, -8, 22, 0
.vwFrame04End
.vwFrame05
db (.vwFrame05End - @) / 4
db 8, -16, 17, 0
db 8, -8, 18, 0
db 0, -16, 19, 0
db 0, -8, 20, 0
db -8, -16, 21, 0
db -8, -8, 22, 0
.vwFrame05End
.vwFrame06
db (.vwFrame06End - @) / 4
db 8, -16, 29, 0
db 8, -8, 30, 0
db 0, -16, 27, 0
db 0, -8, 28, 0
db -8, -16, 21, 0
db -8, -8, 22, 0
.vwFrame06End

View File

@ -29,9 +29,9 @@ Start:
call CopyDMARoutine
ld a, 72
ld a, 100
ld [Player_YPos], a
ld a, 80
ld a, 40
ld [Player_XPos], a
ld a, $FF
ld [Player_GFXCounter], a
@ -49,15 +49,16 @@ Start:
ld [NPC01_XPos], a
ld a, 20
ld [NPC01_GFXCounter], a
xor a
ld a, 1
ld [NPC01_GFXState], a
xor a
ld [NPC01_TileData], a
ld a, HIGH(ActorROM)
ld [NPC01_GFXData+1], a
ld a, LOW(ActorROM)
ld [NPC01_GFXData], a
ld a, 24
ld a, 48
ld [NPC02_YPos], a
ld a, 48
ld [NPC02_XPos], a
@ -71,9 +72,9 @@ Start:
ld a, LOW(ActorROM)
ld [NPC02_GFXData], a
ld a, 48
ld a, 72
ld [NPC03_YPos], a
ld a, 48
ld a, 72
ld [NPC03_XPos], a
ld a, 40
ld [NPC03_GFXCounter], a
@ -85,9 +86,9 @@ Start:
ld a, LOW(ActorROM)
ld [NPC03_GFXData], a
ld a, 48
ld a, 96
ld [NPC04_YPos], a
ld a, 24
ld a, 96
ld [NPC04_XPos], a
ld a, 50
ld [NPC04_GFXCounter], a
@ -99,9 +100,9 @@ Start:
ld a, LOW(ActorROM)
ld [NPC04_GFXData], a
ld a, 64
ld a, 130
ld [NPC05_YPos], a
ld a, 64
ld a, 130
ld [NPC05_XPos], a
ld a, 10
ld [NPC05_GFXCounter], a

View File

@ -2,6 +2,7 @@ INCLUDE "inc/hardware.inc"
INCLUDE "inc/structs.asm"
INCLUDE "ass/parecivo.ass"
INCLUDE "ass/tiles.ass"
INCLUDE "ass/villager.ass"
INCLUDE "ass/map.ass"
INCLUDE "src/animation.asm"
INCLUDE "src/entry.asm"

View File

@ -31,6 +31,14 @@ PC_Update:
ld a, [Player_YPos]
add b
ld [Player_YPos], a
.a:
ld a, [hNewKeys]
and %00000001 ; a pressed
cp %00000001
jr nz, .end
ld a, [Player_GFXState]
xor %00000001
ld [Player_GFXState], a
.end:
ret
@ -74,14 +82,13 @@ Clear_Map:
ret
Load_Tiles:
ld hl, _BGTILES
ld de, parecivo_tile_data
ld bc, parecivo_tile_data_size
call MemCpy
ld hl, _VRAM
ld de, parecivo_tile_data
ld bc, parecivo_tile_data_size
call MemCpy
ld de, VillagerTiles
ld bc, VillagerTilesEnd - VillagerTiles
call MemCpy
ret
Load_Map: