Update AntiKirby
This commit is contained in:
@@ -5,17 +5,17 @@
|
|||||||
!NbrTiles = 02 ; Number of tiles used in a frame
|
!NbrTiles = 02 ; Number of tiles used in a frame
|
||||||
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
|
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
|
||||||
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
|
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
|
||||||
!Health = 10 ; Number of Health the sprite have
|
!Health = 20 ; Number of Health the sprite have
|
||||||
!Damage = 04 ; (08 is a whole heart), 04 is half heart
|
!Damage = 04 ; (08 is a whole heart), 04 is half heart
|
||||||
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
|
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
|
||||||
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
|
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
|
||||||
!SmallShadow = 01 ; 01 = small shadow, 00 = no shadow
|
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
|
||||||
!Shadow = 01 ; 00 = don't draw shadow, 01 = draw a shadow
|
!Shadow = 01 ; 00 = don't draw shadow, 01 = draw a shadow
|
||||||
!Palette = 00 ; Unused in this AntiKirby (can be 0 to 7)
|
!Palette = 00 ; Unused in this AntiKirby (can be 0 to 7)
|
||||||
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool
|
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool
|
||||||
!Persist = 00 ; 01 = your sprite continue to live offscreen
|
!Persist = 00 ; 01 = your sprite continue to live offscreen
|
||||||
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
|
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
|
||||||
!CollisionLayer = 01 ; 01 = will check both layer for collision
|
!CollisionLayer = 00 ; 01 = will check both layer for collision
|
||||||
!CanFall = 00 ; 01 sprite can fall in hole, 01 = can't fall
|
!CanFall = 00 ; 01 sprite can fall in hole, 01 = can't fall
|
||||||
!DeflectArrow = 00 ; 01 = deflect arrows
|
!DeflectArrow = 00 ; 01 = deflect arrows
|
||||||
!WaterSprite = 00 ; 01 = can only walk shallow water
|
!WaterSprite = 00 ; 01 = can only walk shallow water
|
||||||
@@ -32,9 +32,11 @@
|
|||||||
|
|
||||||
|
|
||||||
Sprite_AntiKirby_Long:
|
Sprite_AntiKirby_Long:
|
||||||
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
JSR Sprite_AntiKirby_Draw ; Call the draw code
|
JSR Sprite_AntiKirby_Draw ; Call the draw code
|
||||||
|
JSL Sprite_DrawShadow
|
||||||
JSL Sprite_CheckActive ; Check if game is not paused
|
JSL Sprite_CheckActive ; Check if game is not paused
|
||||||
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
||||||
|
|
||||||
@@ -43,40 +45,70 @@ JSR Sprite_AntiKirby_Main ; Call the main sprite code
|
|||||||
.SpriteIsNotActive
|
.SpriteIsNotActive
|
||||||
PLB ; Get back the databank we stored previously
|
PLB ; Get back the databank we stored previously
|
||||||
RTL ; Go back to original code
|
RTL ; Go back to original code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Sprite_AntiKirby_Prep:
|
Sprite_AntiKirby_Prep:
|
||||||
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
; Add more code here to initialize data
|
; Add more code here to initialize data
|
||||||
|
|
||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
|
}
|
||||||
|
|
||||||
|
!RecoilTime = $30
|
||||||
|
|
||||||
Sprite_AntiKirby_Main:
|
Sprite_AntiKirby_Main:
|
||||||
{
|
{
|
||||||
|
|
||||||
LDA.w SprAction, X; Load the SprAction
|
LDA.w SprAction, X
|
||||||
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|
||||||
dw AntiKirby_Start
|
dw AntiKirby_Start
|
||||||
dw AntiKirby_WalkRight
|
dw AntiKirby_WalkRight
|
||||||
dw AntiKirby_WalkLeft
|
dw AntiKirby_WalkLeft
|
||||||
|
; dw AntiKirby_Main
|
||||||
|
; dw AntiKirby_Moving
|
||||||
|
; dw AntiKirby_Collision
|
||||||
dw AntiKirby_Hurt
|
dw AntiKirby_Hurt
|
||||||
dw AntiKirby_Suck
|
dw AntiKirby_Suck
|
||||||
dw AntiKirby_Full
|
dw AntiKirby_Full
|
||||||
|
dw AntiKirby_Death
|
||||||
|
|
||||||
|
; AntiKirby_Main:
|
||||||
|
; {
|
||||||
|
; %PlayAnimation(0, 0, 10) ; Idle
|
||||||
|
|
||||||
|
; .TileCollision
|
||||||
|
; ; Reset some stuff
|
||||||
|
|
||||||
|
; JSL Sprite_CheckDamageToPlayer
|
||||||
|
; JSL Sprite_CheckDamageFromPlayer
|
||||||
|
|
||||||
|
; JSL Sprite_MoveLong
|
||||||
|
; JSL Sprite_CheckTileCollision
|
||||||
|
|
||||||
|
; LDA $0E70, X : BNE .TileCollision
|
||||||
|
|
||||||
|
; RTS
|
||||||
|
|
||||||
|
; }
|
||||||
|
|
||||||
AntiKirby_Start:
|
AntiKirby_Start:
|
||||||
{
|
{
|
||||||
; %PlayAnimation(0, 0, 10) ; Idle
|
; %PlayAnimation(0, 0, 10) ; Idle
|
||||||
JSL Sprite_DirectionToFacePlayer
|
JSL Sprite_DirectionToFacePlayer
|
||||||
TYA : CMP.b #$02 : BCC .WalkRight
|
TYA : CMP.b #$02 : BCC .WalkRight
|
||||||
|
.WalkLeft
|
||||||
|
; JSL Sprite_IsBelowPlayer : BCS .WalkRight
|
||||||
|
|
||||||
%GotoAction(2)
|
%GotoAction(2)
|
||||||
RTS
|
RTS
|
||||||
.WalkRight
|
.WalkRight
|
||||||
|
JSL Sprite_IsBelowPlayer : BCS .WalkLeft
|
||||||
|
|
||||||
%GotoAction(1)
|
%GotoAction(1)
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -85,12 +117,20 @@ Sprite_AntiKirby_Main:
|
|||||||
{
|
{
|
||||||
%PlayAnimation(0, 3, 10) ; Walk Right
|
%PlayAnimation(0, 3, 10) ; Walk Right
|
||||||
|
|
||||||
|
; JSL Sprite_CheckTileCollision : BEQ .Collision
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
JSL Sprite_CheckDamageFromPlayerLong
|
JSL Sprite_CheckDamageFromPlayerLong : BCC .NoDamage
|
||||||
|
|
||||||
|
LDA #!RecoilTime : STA SprTimerA, X
|
||||||
|
%GotoAction(3) ; Hurt
|
||||||
|
PLX : RTS
|
||||||
|
.NoDamage
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
%MoveTowardPlayer(10)
|
%MoveTowardPlayer(10)
|
||||||
|
.Collision
|
||||||
|
|
||||||
%GotoAction(0)
|
%GotoAction(0)
|
||||||
|
|
||||||
@@ -102,7 +142,11 @@ Sprite_AntiKirby_Main:
|
|||||||
%PlayAnimation(4, 7, 10) ; Walk Left
|
%PlayAnimation(4, 7, 10) ; Walk Left
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
JSL Sprite_CheckDamageFromPlayerLong
|
JSL Sprite_CheckDamageFromPlayerLong : BCC .NoDamage
|
||||||
|
LDA #!RecoilTime : STA SprTimerA, X
|
||||||
|
%GotoAction(3) ; Hurt
|
||||||
|
PLX : RTS
|
||||||
|
.NoDamage
|
||||||
%DoDamageToPlayerSameLayerOnContact()
|
%DoDamageToPlayerSameLayerOnContact()
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
@@ -117,7 +161,16 @@ Sprite_AntiKirby_Main:
|
|||||||
{
|
{
|
||||||
%PlayAnimation(8, 8, 10) ; Hurt
|
%PlayAnimation(8, 8, 10) ; Hurt
|
||||||
|
|
||||||
%MoveTowardPlayer(10)
|
; Check health
|
||||||
|
LDA SprHealth, X : BNE .NotDead
|
||||||
|
%GotoAction(6)
|
||||||
|
RTS
|
||||||
|
|
||||||
|
.NotDead
|
||||||
|
LDA SprTimerA, X : BNE .NotDone
|
||||||
|
%GotoAction(0)
|
||||||
|
|
||||||
|
.NotDone
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -125,31 +178,37 @@ Sprite_AntiKirby_Main:
|
|||||||
AntiKirby_Suck:
|
AntiKirby_Suck:
|
||||||
{
|
{
|
||||||
%PlayAnimation(9, 10, 10) ; Suck
|
%PlayAnimation(9, 10, 10) ; Suck
|
||||||
|
|
||||||
%MoveTowardPlayer(10)
|
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiKirby_Full:
|
AntiKirby_Full:
|
||||||
{
|
{
|
||||||
%PlayAnimation(11, 11, 10) ; Full
|
%PlayAnimation(11, 11, 10) ; Full
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
%MoveTowardPlayer(10)
|
AntiKirby_Death:
|
||||||
|
{
|
||||||
|
%PlayAnimation(8, 8, 10) ; Death
|
||||||
|
|
||||||
|
LDA.b #$06
|
||||||
|
STA.w $0DD0,X
|
||||||
|
|
||||||
|
LDA.b #$0A
|
||||||
|
STA.w $0DF0,X
|
||||||
|
|
||||||
|
STZ.w $0BE0,X
|
||||||
|
|
||||||
|
LDA.b #$09 ; SFX2.1E
|
||||||
|
JSL $0DBB8A ; SpriteSFX_QueueSFX3WithPan
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
;==================================================================================================
|
|
||||||
; Sprite Draw code
|
|
||||||
; --------------------------------------------------------------------------------------------------
|
|
||||||
; Draw the tiles on screen with the data provided by the sprite maker editor
|
|
||||||
;==================================================================================================
|
|
||||||
Sprite_AntiKirby_Draw:
|
Sprite_AntiKirby_Draw:
|
||||||
JSL Sprite_PrepOamCoord
|
JSL Sprite_PrepOamCoord
|
||||||
JSL Sprite_OAM_AllocateDeferToPlayer
|
JSL Sprite_OAM_AllocateDeferToPlayer
|
||||||
Reference in New Issue
Block a user