Added animation system with hit animations for cats

This commit is contained in:
blondie7575 2023-06-30 15:32:17 -07:00
parent 4a9958e5ac
commit b289166038
39 changed files with 1289 additions and 11 deletions

View File

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 249 B

View File

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

BIN
Art/020CatHit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

BIN
Art/020CatHit.xcf Normal file

Binary file not shown.

BIN
Art/021CatHit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
Art/021CatHit.xcf Normal file

Binary file not shown.

BIN
Art/022CatHit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
Art/022CatHit.xcf Normal file

Binary file not shown.

BIN
Art/023CatHit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

BIN
Art/023CatHit.xcf Normal file

Binary file not shown.

BIN
Art/024CatHit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
Art/024CatHit.xcf Normal file

Binary file not shown.

BIN
Art/025CatHit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

BIN
Art/025CatHit.xcf Normal file

Binary file not shown.

BIN
Art/026Cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

BIN
Art/026Cat.xcf Normal file

Binary file not shown.

BIN
Art/027Cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
Art/027Cat.xcf Normal file

Binary file not shown.

BIN
Art/028Cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

BIN
Art/028Cat.xcf Normal file

Binary file not shown.

BIN
Art/029Cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

BIN
Art/029Cat.xcf Normal file

Binary file not shown.

BIN
Art/030Cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
Art/030Cat.xcf Normal file

Binary file not shown.

BIN
Art/031Cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

BIN
Art/031Cat.xcf Normal file

Binary file not shown.

View File

@ -16,6 +16,7 @@
700F72872112428D00225B17 /* RenumberSpriteFiles.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = RenumberSpriteFiles.sh; sourceTree = "<group>"; };
700FFAFB1F40F3BF00A442DE /* font.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = font.s; sourceTree = "<group>"; };
705456862A43E03B00A2B866 /* GeneratePixelCircle.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GeneratePixelCircle.py; sourceTree = "<group>"; };
705456882A4D336200A2B866 /* animation.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = animation.s; sourceTree = "<group>"; };
7059502B1F37A0BE00BBE90F /* GenerateVRAMTable.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateVRAMTable.py; sourceTree = "<group>"; };
705AAFA920040B0D001BB0ED /* terrain_e1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = terrain_e1.s; sourceTree = "<group>"; };
705C54E62124B7F300515A6B /* fan.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = fan.s; sourceTree = "<group>"; };
@ -65,6 +66,7 @@
700C39C51F2E5CA800C24F9C /* tables.s */,
70E266E31F6F262D005AC7E4 /* circleTable.s */,
70F0869F1F413A89002446C3 /* player.s */,
705456882A4D336200A2B866 /* animation.s */,
700B5E6F2069831000B31C00 /* inventory.s */,
700F21DF1F4A364600D7007D /* projectile.s */,
705C54E62124B7F300515A6B /* fan.s */,

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>

Binary file not shown.

1189
animation.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -125,11 +125,11 @@ renderGameObject:
; Call compiled sprite code
txy
SAVE_AXY ; DEBUG BOUNDS RENDER
; SAVE_AXY ; DEBUG BOUNDS RENDER
clc
jsr DrawSpriteBank
RESTORE_AXY ; DEBUG BOUNDS RENDER
; RESTORE_AXY ; DEBUG BOUNDS RENDER
; lda #11 ; DEBUG BOUNDS RENDER
; clc ; DEBUG BOUNDS RENDER
; jsr DrawSpriteBank ; DEBUG BOUNDS RENDER

View File

@ -230,6 +230,23 @@ drawNumber:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; drawSpriteBankSafe
;
; A slightly slower version of Mr Sprite's DrawSpriteBank that
; preserves all registers and requires no secret flag clearing
;
; Y = VRAM position at which to draw
; A = Sprite Index
;
drawSpriteBankSafe:
SAVE_AXY
clc
jsr DrawSpriteBank
RESTORE_AXY
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BORDER_COLOR
;

View File

@ -39,6 +39,7 @@ quitGame:
.include "graphics.s"
.include "font.s"
.include "smallNumbers.s"
.include "animation.s"
.include "player.s"
.include "terrain.s"
.include "collision.s"

View File

@ -20,11 +20,10 @@ playerData:
.word 2 ; Power
.word 100 ; Anger
.byte 8,"SPROCKET " ; Name
.word 1 ; Base Sprite
.word 26 ; Base Sprite
.word 0,5,7,0,0,0,0,0 ; Prices
.word 0 ; Current weapon
.word 7 ; Treats
.repeat 86
.byte 0 ; Padding to 256-byte boundary
.endrepeat
@ -42,7 +41,7 @@ playerData:
.word 2 ; Power
.word 100 ; Anger
.byte 8,"TINKER " ; Name
.word 0 ; Base Sprite
.word 20 ; Base Sprite
.word 0,5,7,0,0,0,0,0 ; Prices
.word 0 ; Current weapon
.word 7 ; Treats
@ -328,6 +327,43 @@ unrenderPlayers:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; renderHitAnimation
;
; Y = Player index to render
; Trashes PARAML0,SCRATCHL
;
renderHitAnimation:
SAVE_AXY
PLAYERPTR_Y
jsr unrenderPlayers
jsr unrenderCrosshair
lda playerData+GO_POSX,y
sta renderHitAnimationPos
lda playerData+GO_POSY,y
clc
adc #GAMEOBJECTHEIGHT
sta renderHitAnimationPos+2
lda #renderHitAnimationPos
sta PARAML0
ldx #5
lda playerData+PD_BASESPRITE,y
inc ; Hit animation starts right above base sprite
tay
jsr renderAnimation
jsr renderPlayers
RESTORE_AXY
rts
renderHitAnimationPos:
.word 0,0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; renderPlayerHeader
;

View File

@ -857,8 +857,17 @@ unrenderProjectileDone:
; Y = Offset to projectile structure
;
processPlayerImpact:
phy
phx
PLAYERPTR_X
; Do hit animation
plx
txy
jsr renderHitAnimation
; Find projectile data structure
ply
lda projectileData+JD_TYPE,y
tay
PROJECTILETYPEPTR_Y
@ -867,7 +876,7 @@ processPlayerImpact:
lda playerData+PD_ANGER,x
sec
sbc projectileTypes+PT_DAMAGE,y
; Check for death
beq processPlayerImpactDeath
bmi processPlayerImpactDeath

View File

@ -2,20 +2,22 @@
DrawSpriteBank :
ASL ; A=Sprite Number ($0000-$0013)
ASL ; A=Sprite Number ($0000-$001F)
TAX ; Y=Target Screen Address ($2000-$9D00)
LDA SpriteBankNum,X ; Relative Sprite Number Table
JMP (SpriteBankBank,X) ; Bank Number Table
SpriteBankNum :
.dbyt $0100,$0000,$0C00,$0500,$0600,$0B00,$1200,$1000
.dbyt $0A00,$0900,$0F00,$1300,$0200,$0300,$0400,$1100
.dbyt $0E00,$0D00,$0800,$0700
.dbyt $0B00,$0A00,$1800,$1100,$1200,$1700,$1E00,$1C00
.dbyt $1500,$1600,$1B00,$1F00,$0D00,$0F00,$1000,$1D00
.dbyt $1A00,$1900,$1400,$1300,$0C00,$0E00,$0600,$0000
.dbyt $0300,$0400,$0800,$0900,$0700,$0200,$0100,$0500
SpriteBankBank :
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
SpriteBankBank00 :
JSL $AA0000

View File

@ -182,6 +182,23 @@ delayShortInner:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; delayMedium
; Sleeps for medium time (about 0.25 sec, but not calculated as such)
;
delayMedium:
SAVE_AX
ldx #$50
delayMediumInner:
jsr delayShort
dex
bne delayMediumInner
RESTORE_AX
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; delayLong
; Sleeps for long time (about 1.5 sec, but not calculated as such)