diff --git a/grafproc.asm b/grafproc.asm index edc67a1..2899385 100644 --- a/grafproc.asm +++ b/grafproc.asm @@ -690,7 +690,13 @@ ZeroesToGo sta (xbyte),y dey bne ClearPM - + ; draw defensive weapons like shield ( tank number in X ) + ; in xdraw, ydraw we have coordinates left LOWER corner of Tank char + lda ActiveDefenceWeapon,x + cmp #56 ; check shield activation + bne NoShieldDraw + jsr DrawTankShield +NoShieldDraw NoPlayerMissile DoNotDrawTankNr rts @@ -718,6 +724,59 @@ tankflash_loop rts .endp +;-------------------------------------------------- +.proc DrawTankShield +; xdraw, ydraw - coordinates left LOWER corner of Tank char +; values remain there after a DrawTankNr proc. +; this proc change xdraw, ydraw and temp! +;-------------------------------------------------- + + mva #1 color + lda erase + beq ShieldVisible + dec color +ShieldVisible + sbw xdraw #$03 ; 3 pixels to left + ; draw left vertical line of scheld ( | ) + mva #6 temp ; strange !!! +@ + jsr plot +.nowarn dew ydraw + dec temp + bne @- + ; draw left oblique line of shield ( / ) + mva #4 temp +@ + jsr plot +.nowarn dew ydraw + inw xdraw + dec temp + bne @- + ; draw top horizontal line of shield ( _ ) + mva #5 temp +@ + jsr plot + inw xdraw + dec temp + bne @- + ; draw right oblique line of shield ( \ ) + mva #4 temp +@ + jsr plot + inw ydraw + inw xdraw + dec temp + bne @- + ; draw right vertical line of shield ( | ) + mva #7 temp +@ + jsr plot + inw ydraw + dec temp + bne @- + rts +.endp + ;-------------------------------------------------- .proc drawmountains ;-------------------------------------------------- diff --git a/scorch.asm b/scorch.asm index 7a325a7..db74289 100644 --- a/scorch.asm +++ b/scorch.asm @@ -129,15 +129,15 @@ START jsr RandomizeSequence ; for the round #1 shooting sequence is random - ; activate parachutes for all players (test) - lda #$35 + ; activate shield for all players (test) + lda #56 ldx numberOfPlayers dex @ sta ActiveDefenceWeapon,x dex bpl @- - ; parachutes activated! (test) + ; shield activated! (test) MainGameLoop VDLI DLIinterruptText ; jsr SetDLI for text (purchase) screen diff --git a/scorch.xex b/scorch.xex index 99b75a8..ec71088 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/weapons.asm b/weapons.asm index de0c2bf..46084c6 100644 --- a/weapons.asm +++ b/weapons.asm @@ -665,8 +665,14 @@ DistanceCheckLoop adc #1 :3 asl tay + ; check shields + lda ActiveDefenceWeapon,x + cmp #56 ; shield + beq UseShield jsr DecreaseEnergyX - + jmp EndOfDistanceCheckLoop +UseShield + mva #0 ActiveDefenceWeapon,x ; deactivate defense weapons TankIsNotWithinTheRange EndOfDistanceCheckLoop txa