-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make mine boss spray dirt when emerging
- Loading branch information
Showing
11 changed files
with
180 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
;;;=========================================================================;;; | ||
;;; Copyright 2022 Matthew D. Steele <[email protected]> ;;; | ||
;;; ;;; | ||
;;; This file is part of Annalog. ;;; | ||
;;; ;;; | ||
;;; Annalog is free software: you can redistribute it and/or modify it ;;; | ||
;;; under the terms of the GNU General Public License as published by the ;;; | ||
;;; Free Software Foundation, either version 3 of the License, or (at your ;;; | ||
;;; option) any later version. ;;; | ||
;;; ;;; | ||
;;; Annalog is distributed in the hope that it will be useful, but WITHOUT ;;; | ||
;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;;; | ||
;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;;; | ||
;;; for more details. ;;; | ||
;;; ;;; | ||
;;; You should have received a copy of the GNU General Public License along ;;; | ||
;;; with Annalog. If not, see <http://www.gnu.org/licenses/>. ;;; | ||
;;;=========================================================================;;; | ||
|
||
.INCLUDE "../actor.inc" | ||
.INCLUDE "../macros.inc" | ||
.INCLUDE "../oam.inc" | ||
.INCLUDE "dirt.inc" | ||
|
||
.IMPORT FuncA_Actor_ApplyGravity | ||
.IMPORT FuncA_Objects_Draw1x1Actor | ||
.IMPORT Func_InitActorDefault | ||
.IMPORT Func_SetActorVelocityPolar | ||
.IMPORT Ram_ActorState1_byte_arr | ||
.IMPORT Ram_ActorType_eActor_arr | ||
|
||
;;;=========================================================================;;; | ||
|
||
;;; The speed of a dirt smoke, in half-pixels per frame. | ||
kDirtSpeed = 6 | ||
|
||
;;; How many frames a dirt smoke lasts before being removed. | ||
kDirtMaxAge = 36 | ||
|
||
;;; The OBJ palette number used for dirt smoke actors. | ||
kPaletteObjDirt = 0 | ||
|
||
;;;=========================================================================;;; | ||
|
||
.SEGMENT "PRGA_Room" | ||
|
||
;;; Initializes the specified actor as a dirt smoke. | ||
;;; @prereq The actor's pixel position has already been initialized. | ||
;;; @param A The angle to move at, measured in increments of tau/256. | ||
;;; @param X The actor index. | ||
;;; @preserve X, T3+ | ||
.EXPORT FuncA_Room_InitActorSmokeDirt | ||
.PROC FuncA_Room_InitActorSmokeDirt | ||
pha ; angle | ||
ldy #eActor::SmokeDirt ; param: actor type | ||
jsr Func_InitActorDefault ; preserves X and T0+ | ||
ldy #kDirtSpeed ; param: speed | ||
pla ; param: angle | ||
jmp Func_SetActorVelocityPolar ; preserves X and T3+ | ||
.ENDPROC | ||
|
||
;;;=========================================================================;;; | ||
|
||
.SEGMENT "PRGA_Actor" | ||
|
||
;;; Performs per-frame updates for a dirt smoke actor. | ||
;;; @param X The actor index. | ||
;;; @preserve X | ||
.EXPORT FuncA_Actor_TickSmokeDirt | ||
.PROC FuncA_Actor_TickSmokeDirt | ||
inc Ram_ActorState1_byte_arr, x ; expiration timer | ||
lda Ram_ActorState1_byte_arr, x ; expiration timer | ||
cmp #kDirtMaxAge | ||
bge _Expire | ||
jmp FuncA_Actor_ApplyGravity ; preserves X | ||
_Expire: | ||
lda #eActor::None | ||
sta Ram_ActorType_eActor_arr, x | ||
rts | ||
.ENDPROC | ||
|
||
;;;=========================================================================;;; | ||
|
||
.SEGMENT "PRGA_Objects" | ||
|
||
;;; Draws a dirt smoke actor. | ||
;;; @param X The actor index. | ||
;;; @preserve X | ||
.EXPORT FuncA_Objects_DrawActorSmokeDirt | ||
.PROC FuncA_Objects_DrawActorSmokeDirt | ||
lda Ram_ActorState1_byte_arr, x ; expiration timer | ||
pha ; expiration timer | ||
and #$18 | ||
.assert bObj::FlipV = $80, error | ||
.assert bObj::FlipH = $40, error | ||
mul #8 | ||
ora #kPaletteObjDirt | ||
tay ; param: object flags | ||
pla ; expiration timer | ||
cmp #kDirtMaxAge * 2 / 3 | ||
blt @big | ||
@small: | ||
lda #kTileIdObjDirtFirst + 1 ; param: tile ID | ||
bne @draw ; unconditional | ||
@big: | ||
lda #kTileIdObjDirtFirst + 0 ; param: tile ID | ||
@draw: | ||
jmp FuncA_Objects_Draw1x1Actor ; preserves X | ||
.ENDPROC | ||
|
||
;;;=========================================================================;;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
;;;=========================================================================;;; | ||
;;; Copyright 2022 Matthew D. Steele <[email protected]> ;;; | ||
;;; ;;; | ||
;;; This file is part of Annalog. ;;; | ||
;;; ;;; | ||
;;; Annalog is free software: you can redistribute it and/or modify it ;;; | ||
;;; under the terms of the GNU General Public License as published by the ;;; | ||
;;; Free Software Foundation, either version 3 of the License, or (at your ;;; | ||
;;; option) any later version. ;;; | ||
;;; ;;; | ||
;;; Annalog is distributed in the hope that it will be useful, but WITHOUT ;;; | ||
;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;;; | ||
;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;;; | ||
;;; for more details. ;;; | ||
;;; ;;; | ||
;;; You should have received a copy of the GNU General Public License along ;;; | ||
;;; with Annalog. If not, see <http://www.gnu.org/licenses/>. ;;; | ||
;;;=========================================================================;;; | ||
|
||
;;; State bytes for dirt smoke: | ||
;;; * Flags: Unused. | ||
;;; * State1: Counter that starts at zero and increments every frame; once it | ||
;;; ticks high enough, the dirt is removed. | ||
;;; * State2: Unused. | ||
;;; * State3: Unused. | ||
;;; * State4: Unused. | ||
|
||
;;; Tile IDs for drawing dirt smoke actors. | ||
kTileIdObjDirtFirst = $a9 | ||
|
||
;;;=========================================================================;;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.