LimitForce added #70

This commit is contained in:
2022-05-28 21:43:55 -04:00
parent aa74cf133b
commit 0820124f9f
6 changed files with 82 additions and 81 deletions
+10 -15
View File
@@ -33,7 +33,7 @@ loop
ArtificialIntelligence .proc ;
; A - skill of the TankNr
; returns shoot energy and angle in
; EnergyTable/L/H and AngleTable
; ForceTable/L/H and AngleTable
;----------------------------------------------
asl
tax
@@ -77,24 +77,19 @@ Shooter .proc
lda PreviousAngle,x
clc
adc #5
bmi leftQuadrant
bmi @+
cmp #90
bcc continue
bcc @+
lda #(-90)
bne continue
leftQuadrant
continue
@
sta NewAngle
lda PreviousEnergyL,x
sta EnergyTableL,x
sta ForceTableL,x
lda PreviousEnergyH,x
sta EnergyTableH,x
sta ForceTableH,x
jmp endo
firstShoot
; compare the x position with the middle of the screen
lda xTanksTableL,x
@@ -108,7 +103,6 @@ firstShoot
and #$1F
clc
adc #5
;lda #45
sta NewAngle
jmp forceNow
@@ -128,11 +122,12 @@ forceNow
endo
ldx TankNr ;this is possibly not necessary
jsr RandomizeForce.LimitForce
lda NewAngle
sta PreviousAngle,x
lda EnergyTableL,x
lda ForceTableL,x
sta PreviousEnergyL,x
lda EnergyTableH,x
lda ForceTableH,x
sta PreviousEnergyH,x
; choose the best weapon