2017-08-15 19:04:22 -07:00
|
|
|
;
|
|
|
|
; gamemanager
|
|
|
|
; The manager for overall game logic
|
|
|
|
;
|
|
|
|
; Created by Quinn Dunki on 8/15/17
|
|
|
|
;
|
|
|
|
|
2017-09-02 17:31:12 -07:00
|
|
|
NUMPLAYERS = 2
|
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
|
|
|
|
beginGameplay:
|
2020-01-05 15:11:14 -08:00
|
|
|
; Initialize random numbers
|
|
|
|
lda #1
|
|
|
|
jsr seedRandom
|
2023-07-20 19:41:06 -07:00
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
; Erase the screen
|
2017-09-30 13:01:36 -07:00
|
|
|
ldx #$0000
|
2018-06-08 12:55:22 -07:00
|
|
|
ldy #200
|
2017-08-15 19:04:22 -07:00
|
|
|
jsr colorFill
|
|
|
|
|
|
|
|
; Generate, compile, and clip terrain
|
2018-01-16 12:56:53 -08:00
|
|
|
stz leftScreenEdge
|
2017-08-15 19:04:22 -07:00
|
|
|
jsr generateTerrain
|
2018-01-16 12:56:53 -08:00
|
|
|
|
2017-09-02 12:32:40 -07:00
|
|
|
; Create players
|
2018-01-21 14:21:44 -08:00
|
|
|
lda #56
|
2017-09-02 17:31:12 -07:00
|
|
|
ldy #0
|
|
|
|
jsr playerCreate
|
|
|
|
|
2017-10-23 12:40:44 -07:00
|
|
|
lda #568
|
2017-09-02 17:31:12 -07:00
|
|
|
ldy #1
|
2017-09-02 12:32:40 -07:00
|
|
|
jsr playerCreate
|
|
|
|
|
2023-07-17 20:36:04 -07:00
|
|
|
jsr syncPlayerHeader
|
2017-08-15 19:04:22 -07:00
|
|
|
ldy #0
|
|
|
|
jsr renderPlayerHeader
|
|
|
|
|
2017-10-19 12:59:24 -07:00
|
|
|
jsr protectPlayers
|
2017-10-22 13:44:05 -07:00
|
|
|
jsr protectProjectiles
|
2017-12-24 12:36:31 -07:00
|
|
|
jsr prepareRowRendering
|
2017-10-19 12:59:24 -07:00
|
|
|
|
2018-01-18 18:15:42 -08:00
|
|
|
jsr compileTerrain
|
|
|
|
jsr clipTerrain
|
2023-07-25 14:33:23 -07:00
|
|
|
jsr renderTerrain
|
|
|
|
|
|
|
|
jsr renderInventory
|
|
|
|
jsr renderPlayers
|
2018-01-18 18:15:42 -08:00
|
|
|
|
2023-07-25 14:33:23 -07:00
|
|
|
; Fade in from menu
|
2023-07-20 19:41:06 -07:00
|
|
|
lda #basePalette
|
|
|
|
sta PARAML2
|
|
|
|
jsr paletteFade
|
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
gameplayLoop:
|
2023-06-24 15:25:08 -07:00
|
|
|
lda projectileActive
|
|
|
|
bpl gameplayLoopKeyboardSkip
|
|
|
|
jsr kbdScanGameplay
|
|
|
|
|
|
|
|
gameplayLoopKeyboardSkip:
|
|
|
|
jsr kbdScanDebug
|
|
|
|
|
2018-12-26 17:10:25 -07:00
|
|
|
; BORDER_COLOR #$F
|
|
|
|
jsr nextVBL
|
|
|
|
|
|
|
|
; BORDER_COLOR #$0
|
|
|
|
|
|
|
|
; Check for pause
|
|
|
|
lda paused
|
2023-06-21 20:07:30 -07:00
|
|
|
beq gameplayLoopBeginUpdate
|
|
|
|
jmp gameplayLoopEndFrame
|
|
|
|
|
|
|
|
gameplayLoopBeginUpdate:
|
2017-08-15 19:04:22 -07:00
|
|
|
|
2018-01-21 14:21:44 -08:00
|
|
|
;;;;;;;;;;;
|
|
|
|
; Update
|
|
|
|
;
|
2018-03-26 12:24:27 -07:00
|
|
|
lda #1
|
|
|
|
sta projectilesDirty
|
2023-06-24 15:25:08 -07:00
|
|
|
lda projectileActive ; Skip interactivity during shots, but still allow map scrolling
|
|
|
|
bpl gameplayLoopShotTracking
|
|
|
|
lda dirtExplosionActive
|
2023-06-25 18:43:07 -07:00
|
|
|
bne gameplayLoopRenderJump ; Skip interactivity during dirt explosions
|
2018-03-26 12:24:27 -07:00
|
|
|
bra gameplayLoopScroll
|
|
|
|
|
2023-06-25 18:43:07 -07:00
|
|
|
gameplayLoopRenderJump:
|
|
|
|
jmp gameplayLoopRender
|
|
|
|
|
2018-03-26 12:24:27 -07:00
|
|
|
gameplayLoopShotTracking:
|
|
|
|
jsr trackActiveShot
|
|
|
|
|
2018-12-26 17:10:25 -07:00
|
|
|
; BORDER_COLOR #$1
|
|
|
|
|
2017-10-22 13:37:06 -07:00
|
|
|
gameplayLoopScroll:
|
2017-08-15 19:04:22 -07:00
|
|
|
; Scroll map if needed
|
|
|
|
lda mapScrollRequested
|
2023-06-24 15:25:08 -07:00
|
|
|
bmi gameplayLoopAngleCheck
|
2023-06-25 18:43:07 -07:00
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
jsr scrollMap
|
|
|
|
|
2023-06-25 18:43:07 -07:00
|
|
|
|
2023-06-24 15:25:08 -07:00
|
|
|
gameplayLoopAngleCheck:
|
|
|
|
lda projectileActive ; Skip interactivity during shots
|
2023-06-25 18:43:07 -07:00
|
|
|
bpl gameplayLoopRenderJmp
|
|
|
|
bra gameplayLoopAngle
|
|
|
|
gameplayLoopRenderJmp:
|
|
|
|
jmp gameplayLoopRender
|
2023-06-24 15:25:08 -07:00
|
|
|
|
2017-08-20 17:51:12 -07:00
|
|
|
gameplayLoopAngle:
|
|
|
|
; Update aim angle if needed
|
2017-08-15 19:04:22 -07:00
|
|
|
lda angleDeltaRequested
|
2023-06-21 20:07:30 -07:00
|
|
|
beq gameplayLoopAim
|
2017-08-15 19:04:22 -07:00
|
|
|
jsr changeAngle
|
|
|
|
|
2023-06-21 20:07:30 -07:00
|
|
|
gameplayLoopAim:
|
|
|
|
jsr unrenderCrosshair
|
|
|
|
ldy currentPlayer
|
|
|
|
jsr updateCrosshair
|
|
|
|
jsr renderCrosshair
|
|
|
|
|
2017-09-05 12:55:27 -07:00
|
|
|
gameplayLoopPower:
|
|
|
|
; Update power if needed
|
|
|
|
lda powerDeltaRequested
|
|
|
|
beq gameplayLoopFire
|
|
|
|
jsr changePower
|
|
|
|
|
2017-08-20 17:51:12 -07:00
|
|
|
gameplayLoopFire:
|
|
|
|
lda fireRequested
|
2023-07-30 15:46:59 -07:00
|
|
|
beq gameplayLoopMove
|
2023-06-24 15:25:08 -07:00
|
|
|
jsr unrenderCrosshair
|
2017-08-20 17:51:12 -07:00
|
|
|
jsr fire
|
2023-06-21 20:07:30 -07:00
|
|
|
|
2023-07-30 15:46:59 -07:00
|
|
|
gameplayLoopMove:
|
|
|
|
lda playerMoveRequested
|
|
|
|
beq gameplayLoopRender
|
|
|
|
jsr move
|
|
|
|
|
2018-12-26 17:10:25 -07:00
|
|
|
; BORDER_COLOR #$2
|
|
|
|
|
2018-01-21 14:21:44 -08:00
|
|
|
gameplayLoopRender:
|
2018-12-26 17:10:25 -07:00
|
|
|
; sta KBDSTROBE
|
2017-08-22 20:33:07 -07:00
|
|
|
|
2018-01-21 14:21:44 -08:00
|
|
|
;;;;;;;;;;;
|
|
|
|
; Render
|
|
|
|
;
|
|
|
|
|
|
|
|
; Render the terrain if needed
|
2018-03-05 12:32:05 -08:00
|
|
|
lda terrainDirty
|
2020-01-05 15:11:14 -08:00
|
|
|
beq gameplayLoopExplosions
|
2018-07-28 15:46:54 -07:00
|
|
|
; jsl renderTerrainSpans ; Part of the now disabled fill-mode renderer
|
2018-01-21 14:21:44 -08:00
|
|
|
jsr renderTerrain
|
|
|
|
stz terrainDirty
|
|
|
|
|
|
|
|
; Render players
|
2018-03-06 18:31:54 -08:00
|
|
|
jsr renderPlayers
|
2018-01-21 14:21:44 -08:00
|
|
|
|
2020-01-05 15:11:14 -08:00
|
|
|
gameplayLoopExplosions:
|
|
|
|
; Render explosions
|
|
|
|
jsr renderDirtExplosion
|
|
|
|
|
2018-01-21 14:21:44 -08:00
|
|
|
gameplayLoopProjectiles:
|
2018-12-26 17:10:25 -07:00
|
|
|
|
|
|
|
; BORDER_COLOR #$3
|
|
|
|
|
2018-03-26 12:24:27 -07:00
|
|
|
lda projectilesDirty
|
|
|
|
beq gameplayLoopProjectilesSkip
|
|
|
|
|
|
|
|
jsr unrenderProjectiles
|
2018-12-23 17:39:22 -07:00
|
|
|
jsr updateProjectilesPhysics
|
2018-03-26 12:24:27 -07:00
|
|
|
jsr protectProjectiles
|
|
|
|
jsr renderProjectiles
|
|
|
|
|
|
|
|
gameplayLoopProjectilesSkip:
|
2018-12-23 17:39:22 -07:00
|
|
|
jsr updateProjectilesCollisions
|
2018-01-21 14:21:44 -08:00
|
|
|
|
2018-06-10 18:05:20 -06:00
|
|
|
lda inventoryDirty
|
|
|
|
beq gameplayLoopVictoryCondition
|
|
|
|
stz inventoryDirty
|
|
|
|
jsr renderInventory
|
2017-08-15 19:04:22 -07:00
|
|
|
|
2018-12-26 17:10:25 -07:00
|
|
|
; BORDER_COLOR #$4
|
|
|
|
|
2017-09-03 17:20:24 -07:00
|
|
|
gameplayLoopVictoryCondition:
|
|
|
|
lda gameOver
|
2018-07-22 10:11:51 -05:00
|
|
|
bmi gameplayEndTurnCondition
|
2017-09-03 17:20:24 -07:00
|
|
|
jsr endGame
|
|
|
|
|
2018-07-22 10:11:51 -05:00
|
|
|
gameplayEndTurnCondition:
|
|
|
|
lda turnRequested
|
|
|
|
beq gameplayLoopEndFrame
|
2020-01-05 15:48:59 -08:00
|
|
|
lda dirtExplosionActive
|
|
|
|
bne gameplayLoopEndFrame
|
2018-07-22 10:11:51 -05:00
|
|
|
jsr endTurn
|
|
|
|
|
2017-09-02 17:31:12 -07:00
|
|
|
gameplayLoopEndFrame:
|
2019-02-22 18:52:07 -05:00
|
|
|
lda singleStep
|
|
|
|
beq gameplayLoopEndFrameCont
|
|
|
|
lda #1
|
|
|
|
sta paused
|
|
|
|
|
|
|
|
gameplayLoopEndFrameCont:
|
2017-08-15 19:04:22 -07:00
|
|
|
lda quitRequested
|
2017-12-23 19:01:16 -07:00
|
|
|
beq gameplayLoopContinue
|
2023-07-25 14:33:23 -07:00
|
|
|
|
|
|
|
; Transition back to menu
|
|
|
|
stz quitRequested
|
|
|
|
lda #skyPalette
|
|
|
|
sta PARAML2
|
|
|
|
jsr paletteFade
|
|
|
|
jmp titleScreen
|
|
|
|
|
2017-12-23 19:01:16 -07:00
|
|
|
gameplayLoopContinue:
|
|
|
|
jmp gameplayLoop
|
2017-08-15 19:04:22 -07:00
|
|
|
|
2017-10-22 13:37:06 -07:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; trackActiveShot
|
|
|
|
;
|
|
|
|
; Handles tracking the projectile with the camera
|
|
|
|
;
|
|
|
|
; Trashes SCRATCHL
|
|
|
|
;
|
|
|
|
trackActiveShot:
|
2018-12-26 17:10:25 -07:00
|
|
|
ldy projectileActive
|
|
|
|
lda projectileData+JD_PRECISEX,y
|
2017-10-22 13:37:06 -07:00
|
|
|
lsr ; Convert to integer and divide by two for byte distance
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
sta SCRATCHL ; Save this for later
|
|
|
|
|
2018-12-26 17:10:25 -07:00
|
|
|
lda projectileData+JD_VX,y
|
2017-10-22 13:37:06 -07:00
|
|
|
bmi trackActiveShotNeg
|
|
|
|
|
|
|
|
; Left-to-right
|
|
|
|
lda mapScrollPos
|
|
|
|
cmp #VISIBLETERRAINWIDTH-VISIBLETERRAINWINDOW
|
|
|
|
beq trackActiveShotDone ; Logical-right edge clamp
|
|
|
|
|
|
|
|
lda SCRATCHL
|
|
|
|
sec
|
2018-07-28 17:33:56 -07:00
|
|
|
sbc #150 ; Check for moving close to right edge
|
2017-10-22 13:37:06 -07:00
|
|
|
cmp leftScreenEdge
|
2018-07-28 16:20:37 -07:00
|
|
|
bmi trackActiveShotDone
|
|
|
|
|
|
|
|
lda #80 ; Move screen right to see shot land
|
|
|
|
sta mapScrollRequested
|
2017-10-22 13:37:06 -07:00
|
|
|
|
|
|
|
trackActiveShotNeg:
|
|
|
|
|
|
|
|
; Right-to-left
|
|
|
|
lda mapScrollPos
|
|
|
|
beq trackActiveShotDone ; Logical-left edge clamp
|
|
|
|
|
|
|
|
lda SCRATCHL
|
|
|
|
clc
|
2018-07-28 17:33:56 -07:00
|
|
|
adc #150 ; Check for moving close to left edge
|
2017-10-22 13:37:06 -07:00
|
|
|
cmp rightScreenEdge
|
|
|
|
bpl trackActiveShotDone
|
2018-07-28 16:20:37 -07:00
|
|
|
stz mapScrollRequested ; Move screen left to see shot land
|
2017-10-22 13:37:06 -07:00
|
|
|
|
|
|
|
trackActiveShotDone:
|
|
|
|
rts
|
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
|
2017-09-02 17:31:12 -07:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; endTurn
|
|
|
|
;
|
|
|
|
; Handles changing the active player
|
|
|
|
;
|
|
|
|
endTurn:
|
2019-02-22 19:00:48 -05:00
|
|
|
lda currentPlayer
|
|
|
|
inc
|
|
|
|
cmp #NUMPLAYERS
|
|
|
|
beq endTurnWrap
|
2017-09-02 17:31:12 -07:00
|
|
|
sta currentPlayer
|
|
|
|
|
|
|
|
endTurnRefresh:
|
2018-12-29 17:45:40 -07:00
|
|
|
jsr processTurnForProjectiles
|
|
|
|
|
2017-09-02 17:31:12 -07:00
|
|
|
ldy currentPlayer
|
2018-07-28 17:33:56 -07:00
|
|
|
beq endTurnFocusPlayer0
|
|
|
|
|
|
|
|
lda #VISIBLETERRAINWINDOW
|
|
|
|
sta mapScrollRequested
|
|
|
|
|
|
|
|
endTurnHeader:
|
2023-07-17 20:36:04 -07:00
|
|
|
jsr syncPlayerHeader
|
2017-09-02 17:31:12 -07:00
|
|
|
jsr renderPlayerHeader
|
2018-07-28 17:33:56 -07:00
|
|
|
jsr renderInventory
|
2017-09-02 17:31:12 -07:00
|
|
|
stz turnRequested
|
|
|
|
rts
|
|
|
|
|
2018-07-28 17:33:56 -07:00
|
|
|
endTurnFocusPlayer0:
|
|
|
|
stz mapScrollRequested
|
|
|
|
bra endTurnHeader
|
|
|
|
|
2017-09-02 17:31:12 -07:00
|
|
|
endTurnWrap:
|
|
|
|
stz currentPlayer
|
|
|
|
bra endTurnRefresh
|
|
|
|
|
|
|
|
|
2017-09-03 17:20:24 -07:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; endGame
|
|
|
|
;
|
|
|
|
; Handles someone winning
|
|
|
|
;
|
|
|
|
endGame:
|
|
|
|
lda #1
|
|
|
|
sta quitRequested
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; scrollMap
|
|
|
|
;
|
|
|
|
; Handles updating the state of the terrain in response to scrolling
|
|
|
|
;
|
2017-10-09 14:53:24 -07:00
|
|
|
; A = New map scroll position
|
|
|
|
;
|
2017-08-15 19:04:22 -07:00
|
|
|
scrollMap:
|
2018-01-18 18:15:42 -08:00
|
|
|
jsr unclipTerrain
|
2018-07-28 15:46:54 -07:00
|
|
|
; jsl unrenderTerrainSpans ; Part of the now disabled fill-mode renderer
|
2018-03-06 18:31:54 -08:00
|
|
|
jsr unrenderPlayers
|
2018-03-26 12:24:27 -07:00
|
|
|
jsr unrenderProjectiles
|
|
|
|
|
2023-06-25 18:43:07 -07:00
|
|
|
pha
|
|
|
|
lda projectileActive ; Crosshair is visible if projectile isn't
|
|
|
|
beq scrollMapApplyScrolling
|
|
|
|
jsr unrenderCrosshair
|
|
|
|
|
|
|
|
scrollMapApplyScrolling:
|
|
|
|
pla
|
2018-12-23 17:39:22 -07:00
|
|
|
; jsr updateProjectilePhysics ; Good idea?
|
2017-08-15 19:04:22 -07:00
|
|
|
|
|
|
|
sta mapScrollPos
|
|
|
|
asl
|
|
|
|
sta leftScreenEdge
|
2017-09-02 12:32:40 -07:00
|
|
|
clc
|
2017-09-05 12:48:30 -07:00
|
|
|
adc #160-GAMEOBJECTWIDTH/4-1
|
2017-09-02 12:32:40 -07:00
|
|
|
sta rightScreenEdge
|
2017-08-15 19:04:22 -07:00
|
|
|
|
2018-01-18 18:15:42 -08:00
|
|
|
jsr clipTerrain
|
2017-08-15 19:04:22 -07:00
|
|
|
lda #$ffff
|
|
|
|
sta mapScrollRequested
|
|
|
|
|
2018-03-06 18:31:54 -08:00
|
|
|
jsr protectPlayers
|
2018-03-26 12:24:27 -07:00
|
|
|
jsr protectProjectiles
|
2018-03-06 18:31:54 -08:00
|
|
|
jsr renderPlayers
|
2018-03-26 12:24:27 -07:00
|
|
|
jsr renderProjectiles ; Prevents flicker, but ads jitter to shot tracking
|
2023-06-25 18:43:07 -07:00
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
lda #1
|
|
|
|
sta terrainDirty
|
2018-03-26 12:24:27 -07:00
|
|
|
stz projectilesDirty
|
2017-08-15 19:04:22 -07:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; changeAngle
|
|
|
|
;
|
|
|
|
; Handles changing a player's aim
|
|
|
|
;
|
|
|
|
changeAngle:
|
2017-09-02 17:31:12 -07:00
|
|
|
ldy currentPlayer
|
2017-08-15 19:04:22 -07:00
|
|
|
tax
|
|
|
|
jsr playerDeltaAngle
|
|
|
|
|
2023-07-25 14:45:29 -07:00
|
|
|
; ldy currentPlayer
|
|
|
|
; jsr renderPlayerHeader
|
2017-08-15 19:04:22 -07:00
|
|
|
|
|
|
|
stz angleDeltaRequested
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2017-09-05 12:55:27 -07:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; changePower
|
|
|
|
;
|
|
|
|
; Handles changing a player's power
|
|
|
|
;
|
|
|
|
changePower:
|
|
|
|
ldy currentPlayer
|
|
|
|
tax
|
|
|
|
jsr playerDeltaPower
|
|
|
|
|
2023-07-25 14:45:29 -07:00
|
|
|
; ldy currentPlayer
|
|
|
|
; jsr renderPlayerHeader
|
2017-09-05 12:55:27 -07:00
|
|
|
|
|
|
|
stz powerDeltaRequested
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2017-08-20 17:51:12 -07:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; fire
|
|
|
|
;
|
|
|
|
; Handles firing a player's weapon
|
|
|
|
;
|
|
|
|
fire:
|
|
|
|
stz fireRequested
|
2017-09-02 17:31:12 -07:00
|
|
|
ldy currentPlayer
|
2017-08-20 17:51:12 -07:00
|
|
|
jsr playerFire
|
2021-09-23 12:36:48 -06:00
|
|
|
jsr renderPlayerHeader
|
2017-08-20 17:51:12 -07:00
|
|
|
rts
|
|
|
|
|
|
|
|
|
2023-07-30 15:46:59 -07:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; move
|
|
|
|
;
|
|
|
|
; Handles moving a player
|
|
|
|
;
|
|
|
|
move:
|
|
|
|
jsr unrenderCrosshair
|
|
|
|
jsr unrenderPlayers
|
|
|
|
lda #playerData
|
|
|
|
sta PARAML0
|
|
|
|
ldx playerMoveRequested
|
|
|
|
jsr moveGameObjectOnTerrain
|
|
|
|
stz playerMoveRequested
|
|
|
|
jsr renderPlayers
|
|
|
|
jsr renderCrosshair
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
basePalette:
|
2023-07-20 19:41:06 -07:00
|
|
|
.word $06af,$0072,$0072,$0861,$0c93,$0eb4,$0d66,$0f9a,$0777,$0d00,$0bbb,$ddd,$007b,$0a5b,$0000,$0fff
|
2017-09-30 13:01:36 -07:00
|
|
|
|
|
|
|
|
2017-08-15 19:04:22 -07:00
|
|
|
quitRequested:
|
|
|
|
.word $0000
|
|
|
|
mapScrollRequested:
|
|
|
|
.word $FFFF
|
|
|
|
angleDeltaRequested:
|
|
|
|
.word $0000
|
2017-09-05 12:55:27 -07:00
|
|
|
powerDeltaRequested:
|
|
|
|
.word $0000
|
2017-08-20 17:51:12 -07:00
|
|
|
fireRequested:
|
|
|
|
.word $0000
|
2017-09-02 17:31:12 -07:00
|
|
|
turnRequested:
|
|
|
|
.word $0000
|
2023-07-30 15:46:59 -07:00
|
|
|
playerMoveRequested:
|
|
|
|
.word $0000
|
2017-08-15 19:04:22 -07:00
|
|
|
terrainDirty:
|
|
|
|
.word 1
|
2018-03-26 12:24:27 -07:00
|
|
|
projectilesDirty:
|
|
|
|
.word 1
|
2018-06-10 18:05:20 -06:00
|
|
|
inventoryDirty:
|
|
|
|
.word 1
|
2017-09-02 17:31:12 -07:00
|
|
|
currentPlayer:
|
|
|
|
.word 0
|
2017-09-03 17:20:24 -07:00
|
|
|
gameOver:
|
|
|
|
.word -1 ; Player index of winner
|
2017-09-05 12:48:30 -07:00
|
|
|
projectileActive:
|
2018-12-26 17:10:25 -07:00
|
|
|
.word -1 ; Y offset of active shot
|
2017-09-30 13:01:36 -07:00
|
|
|
paused:
|
|
|
|
.word 0
|
2019-02-22 18:52:07 -05:00
|
|
|
singleStep:
|
|
|
|
.word 0
|
2018-12-29 11:33:08 -07:00
|
|
|
globalWind:
|
|
|
|
.word 0 ; 12.4 velocity
|
2017-08-15 19:04:22 -07:00
|
|
|
|
|
|
|
; Position of map viewing window. Can be visualized in two ways:
|
|
|
|
; a) Word-distance from right edge of terrain data (which is in memory right-to-left) to left edge of visible screen
|
2017-09-02 12:32:40 -07:00
|
|
|
; b) Byte-distance from left edge of logical terrain to left edge of visible screen
|
|
|
|
; c) Byte-distance from left edge of logical terrain to right edge of visible screen minus game object width in words
|
2017-08-15 19:04:22 -07:00
|
|
|
mapScrollPos:
|
|
|
|
.word 0
|
2018-01-16 12:56:53 -08:00
|
|
|
;leftScreenEdge = $6E ; Moved to zero page for speed and cross-bank convenience
|
|
|
|
; .word 0
|
2017-09-02 12:32:40 -07:00
|
|
|
rightScreenEdge:
|
2017-09-05 12:48:30 -07:00
|
|
|
.word 160-GAMEOBJECTWIDTH/4-1
|
2019-02-22 18:52:07 -05:00
|
|
|
|