瀏覽代碼

added more actors to demonstrate

master
Thorn Avery 4 年之前
父節點
當前提交
31327d35ee
共有 2 個文件被更改,包括 86 次插入1 次删除
  1. +5
    -0
      src/animation.asm
  2. +81
    -1
      src/entry.asm

+ 5
- 0
src/animation.asm 查看文件

@@ -14,6 +14,11 @@
SECTION "Actor STructs", WRAM0

dstruct Actor, Player
dstruct Actor, NPC01
dstruct Actor, NPC02
dstruct Actor, NPC03
dstruct Actor, NPC04
dstruct Actor, NPC05

SECTION "Animation Variables", HRAM



+ 81
- 1
src/entry.asm 查看文件

@@ -43,6 +43,76 @@ Start:
ld a, LOW(ActorROM)
ld [Player_GFXData], a

ld a, 24
ld [NPC01_YPos], a
ld a, 24
ld [NPC01_XPos], a
ld a, 20
ld [NPC01_GFXCounter], a
xor a
ld [NPC01_GFXState], 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 [NPC02_YPos], a
ld a, 48
ld [NPC02_XPos], a
ld a, 30
ld [NPC02_GFXCounter], a
xor a
ld [NPC02_GFXState], a
ld [NPC02_TileData], a
ld a, HIGH(ActorROM)
ld [NPC02_GFXData+1], a
ld a, LOW(ActorROM)
ld [NPC02_GFXData], a

ld a, 48
ld [NPC03_YPos], a
ld a, 48
ld [NPC03_XPos], a
ld a, 40
ld [NPC03_GFXCounter], a
xor a
ld [NPC03_GFXState], a
ld [NPC03_TileData], a
ld a, HIGH(ActorROM)
ld [NPC03_GFXData+1], a
ld a, LOW(ActorROM)
ld [NPC03_GFXData], a

ld a, 48
ld [NPC04_YPos], a
ld a, 24
ld [NPC04_XPos], a
ld a, 50
ld [NPC04_GFXCounter], a
xor a
ld [NPC04_GFXState], a
ld [NPC04_TileData], a
ld a, HIGH(ActorROM)
ld [NPC04_GFXData+1], a
ld a, LOW(ActorROM)
ld [NPC04_GFXData], a

ld a, 64
ld [NPC05_YPos], a
ld a, 64
ld [NPC05_XPos], a
ld a, 10
ld [NPC05_GFXCounter], a
xor a
ld [NPC05_GFXState], a
ld [NPC05_TileData], a
ld a, HIGH(ActorROM)
ld [NPC05_GFXData+1], a
ld a, LOW(ActorROM)
ld [NPC05_GFXData], a

ld a, LCDCF_ON | LCDCF_OBJON | LCDCF_BGON
ld [rLCDC], a

@@ -50,10 +120,20 @@ game_loop:
call Hide_OAM
call Read_Pad
call PC_Update
call Wait_VBlank
ld de, wShadowOAM
ld hl, Player
call RenderActor
ld hl, NPC01
call RenderActor
ld hl, NPC02
call RenderActor
ld hl, NPC03
call RenderActor
ld hl, NPC04
call RenderActor
ld hl, NPC05
call RenderActor
call Wait_VBlank
ld a, HIGH(wShadowOAM)
call hOAMDMA
jr game_loop


Loading…
取消
儲存