diff options
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | attacks.gbasm | 50 | ||||
-rw-r--r-- | definitions.gbasm | 1 | ||||
-rw-r--r-- | dialogues.gbasm | 8 | ||||
-rw-r--r-- | dialogues.gbtxt | 8 | ||||
-rw-r--r-- | entity/actions.gbasm | 15 | ||||
-rw-r--r-- | gui.gbasm | 36 | ||||
-rw-r--r-- | main.gbasm | 18 | ||||
-rw-r--r-- | map/loading.gbasm | 34 |
9 files changed, 135 insertions, 39 deletions
@@ -1,5 +1,3 @@ --> Spawn enemies in far away rooms when less than X enemies on the map. (Maybe despawn some too) - -> Add special attacks/capacities to the bunny * Jump x2 (even over an enemy) (attacking or not ?) * Stronger attack @@ -7,6 +5,8 @@ * Freeze a/multiple fox(es) for X turns -> All with limited number of uses +-> Spawn enemies in far away rooms when less than X enemies on the map. (Maybe despawn some too) + -> Remove some health to the bunny (probably to 10 points, maybe max health growing ?) -> Add objects to heal and get back limited use attacks/learn new attacks diff --git a/attacks.gbasm b/attacks.gbasm new file mode 100644 index 0000000..b758f89 --- /dev/null +++ b/attacks.gbasm @@ -0,0 +1,50 @@ +Hop_Attack_Loading_VBlank: + LD A, $mem_current_mode + CP $enum_loading_mode + RET NZ + + LD A, $mem_viewport_y + INC A + LD $mem_viewport_y, A + LD C, $00 + Hop_Attack_Loading_VBlank.loop: + PUSH BC + LD A, $mem_bunny_direction + AND $07 + DEC A + AND $01 + SLA A + DEC A + LD B, A + LD A, $mem_bunny_direction + AND $07 + DEC A + + BIT 1, A + JR NZ, =Hop_Attack_Loading_VBlank.Map_Load.vertical + + Hop_Attack_Loading_VBlank.Map_Load.horizontal: + CALL =Load_Next_Block_Column + JR =Hop_Attack_Loading_VBlank.Map_Load.End + + Hop_Attack_Loading_VBlank.Map_Load.vertical: + CALL =Load_Next_Block_Row + + Hop_Attack_Loading_VBlank.Map_Load.End: + POP BC + INC C + LD A, $10 + CP C + JR NZ, =Hop_Attack_Loading_VBlank.loop + + LD A, $mem_viewport_y + DEC A + LD $mem_viewport_y, A + + LD A, $enum_dungeon_mode + LD $mem_current_mode, A + LD $mem_requested_mode, A + RET + +Hop_Attack_Loading_Regular: + RET diff --git a/definitions.gbasm b/definitions.gbasm index 626cd2a..0dc9a56 100644 --- a/definitions.gbasm +++ b/definitions.gbasm @@ -57,6 +57,7 @@ .DEFINE enum_dungeon_mode $00 .DEFINE enum_dungeon_menu_mode $01 .DEFINE enum_dungeon_dialogue_mode $02 +.DEFINE enum_loading_mode $03 .DEFINE mem_menu_cursor_position ($c016) .DEFINE mem_last_button_direction ($c017) diff --git a/dialogues.gbasm b/dialogues.gbasm index 416acfa..9a9aa1c 100644 --- a/dialogues.gbasm +++ b/dialogues.gbasm @@ -3,10 +3,10 @@ Bunny_Prefix: Text_1: .DB 0x91, 0x8e, 0x95, 0x95, 0x98, 0x0, 0xa5, 0xff Menu_Choice_1: -.DB 0x95, 0x9e, 0x97, 0x8a, 0xff +.DB 0x91, 0x98, 0x99, 0xff Menu_Choice_2: -.DB 0x8a, 0xa3, 0x9e, 0x9b, 0x8e, 0xff +.DB 0x9c, 0x9d, 0x8a, 0x96, 0x99, 0xff Menu_Choice_3: -.DB 0xa0, 0x92, 0x9d, 0x8c, 0x91, 0xff +.DB 0x8f, 0x9b, 0x8e, 0x8e, 0xa3, 0x8e, 0xff Menu_Choice_4: -.DB 0x98, 0xa0, 0x95, 0xff +.DB 0x8e, 0x8a, 0x9b, 0x8c, 0x98, 0x99, 0x9d, 0x9b, 0xff diff --git a/dialogues.gbtxt b/dialogues.gbtxt index f367f49..d9b5942 100644 --- a/dialogues.gbtxt +++ b/dialogues.gbtxt @@ -1,6 +1,6 @@ Bunny_Prefix: Bunny: Text_1: Hello ! -Menu_Choice_1: Luna -Menu_Choice_2: Azure -Menu_Choice_3: Witch -Menu_Choice_4: Owl +Menu_Choice_1: Hop +Menu_Choice_2: Stamp +Menu_Choice_3: Freeze +Menu_Choice_4: Earcoptr diff --git a/entity/actions.gbasm b/entity/actions.gbasm index b1e48a8..1416304 100644 --- a/entity/actions.gbasm +++ b/entity/actions.gbasm @@ -118,14 +118,13 @@ Fox_Interaction: RET Open_Dialogue: - CALL =Init_Menu - ; LD HL, $dialogue_first_line - ; LD BC, =Bunny_Prefix - ; CALL =Print_str - - ; LD HL, $dialogue_third_line - ; LD BC, =Text_1 - ; CALL =Print_str + LD HL, $dialogue_first_line + LD BC, =Bunny_Prefix + CALL =Print_str + + LD HL, $dialogue_third_line + LD BC, =Text_1 + CALL =Print_str LD A, $01 LD $mem_display_flag, A @@ -35,7 +35,7 @@ Init_Menu: CALL =Print_str LD HL, $dialogue_menu_choice1_routine - LD BC, =Exit_Menu + LD BC, =Change_To_Loading_Mode LD A, B LD (HL+), A LD A, C @@ -72,6 +72,14 @@ Exit_Menu: LD $mem_display_flag, A RET +Change_To_Loading_Mode: + LD A, $enum_loading_mode + LD $mem_requested_mode, A + + LD A, $00 + LD $mem_display_flag, A + RET + Display_dialogue_cursor: LD A, $mem_current_mode CP $enum_dungeon_menu_mode @@ -147,6 +155,8 @@ Check_dialogue_action: LD A, $mem_button_action CP B RET Z + BIT 3, A + JP NZ, =Exit_Menu BIT 0, A RET Z @@ -164,3 +174,27 @@ Check_dialogue_action: .CALL_DE RET + +Check_Open_Menu_button: + LD A, $mem_last_button_action + AND $08 + LD B, A + LD A, $mem_button_action + AND $08 + CP B + RET Z + BIT 3, A + RET Z + + CALL =Init_Menu + + LD A, $01 + LD $mem_display_flag, A + + LD A, $mem_bunny_direction + AND $0f + LD $mem_bunny_direction, A + + LD A, $enum_dungeon_menu_mode + LD $mem_requested_mode, A + RET @@ -111,8 +111,14 @@ VBLANK_Entrypoint: LD A, $68 LD (HL), A - CALL =Display_Prepared_Block - CALL =Display_Object + LD A, $mem_current_mode + CP $enum_dungeon_mode + JR NZ, =Skip_VBlank_Dungeon_Update + CALL =Display_Prepared_Block + CALL =Display_Object + Skip_VBlank_Dungeon_Update: + + CALL =Hop_Attack_Loading_VBlank CALL =Copy_Dialogue_Buffer CALL =Display_dialogue_cursor CALL $OAM_DMA_Transfer_routine @@ -130,13 +136,14 @@ VBLANK_Entrypoint: CP $enum_dungeon_mode JR NZ, =Skip_Dungeon_Update - CALL =Object_Interactions_Check - CALL =Entities_Actions - CALL =Prepare_Scrolling_Map + CALL =Object_Interactions_Check + CALL =Entities_Actions + CALL =Prepare_Scrolling_Map Skip_Dungeon_Update: CALL =Update_Animation_Steps + CALL =Check_Open_Menu_button CALL =Move_dialogue_cursor CALL =Check_dialogue_action CALL =Display_Entities @@ -198,6 +205,7 @@ STAT_Entrypoint: .INCLUDE "entity/actions.gbasm" .INCLUDE "entity/collisions.gbasm" .INCLUDE "entity/display.gbasm" +.INCLUDE "attacks.gbasm" .INCLUDE "gui.gbasm" .INCLUDE "tileset.gbasm" .INCLUDE "dialogues.gbasm" diff --git a/map/loading.gbasm b/map/loading.gbasm index 7c4a0e9..ca1e3f4 100644 --- a/map/loading.gbasm +++ b/map/loading.gbasm @@ -27,29 +27,29 @@ Load_Map: RET -Load_Row: ; (+1/-1 direction in B) +Load_Next_Block_Row: ; (+1/-1 direction in B, block number (between 0-f) in C PUSH AF PUSH BC PUSH DE LD A, B CP $01 - JR NZ, =Load_Row.Up + JR NZ, =Load_Next_Block_Row.Up LD A, $mem_viewport_y ADD $0C LD B, A - JR =Load_Row.Set_X_Limits + JR =Load_Next_Block_Row.Set_X_Limits - Load_Row.Up: + Load_Next_Block_Row.Up: LD A, $mem_viewport_y SUB $02 LD B, A - Load_Row.Set_X_Limits: + Load_Next_Block_Row.Set_X_Limits: LD A, $mem_viewport_x SUB $03 LD D, A - LD A, $mem_moving_animation_step + LD A, C ADD D LD D, A LD A, $mem_viewport_x @@ -63,32 +63,33 @@ Load_Row: ; (+1/-1 direction in B) POP AF RET -Load_Column: ; (+1/-1 direction in B) +Load_Next_Block_Column: ; (+1/-1 direction in B), block number (between 0-f) in C + PUSH AF PUSH BC PUSH DE LD A, B CP $01 - JR NZ, =Load_Column.Left + JR NZ, =Load_Next_Block_Column.Left LD A, $mem_viewport_x ADD $0C LD D, A - JR =Load_Column.Set_Y_Limits + JR =Load_Next_Block_Column.Set_Y_Limits - Load_Column.Left: + Load_Next_Block_Column.Left: LD A, $mem_viewport_x SUB $02 LD D, A - Load_Column.Set_Y_Limits: + Load_Next_Block_Column.Set_Y_Limits: LD A, $mem_viewport_y SUB $03 LD B, A LD A, $mem_viewport_y ADD $0D LD E, A - LD A, $mem_moving_animation_step + LD A, C ADD B LD B, A LD A, D @@ -104,6 +105,9 @@ Prepare_Scrolling_Map: BIT 0, A JR Z, =Display_Scrolling_Map.End + LD A, $mem_moving_animation_step + LD C, A + LD A, $mem_bunny_direction AND $07 DEC A @@ -119,11 +123,11 @@ Prepare_Scrolling_Map: JR NZ, =Display_Scrolling_Map.vertical Display_Scrolling_Map.horizontal: - CALL =Load_Column - JP =Display_Scrolling_Map.End + CALL =Load_Next_Block_Column + JR =Display_Scrolling_Map.End Display_Scrolling_Map.vertical: - CALL =Load_Row + CALL =Load_Next_Block_Row Display_Scrolling_Map.End: RET |