diff --git a/definitions.asm b/definitions.asm index 0b04e1e..25bb623 100644 --- a/definitions.asm +++ b/definitions.asm @@ -4,6 +4,7 @@ screenheight = 200 screenBytes = 40 screenwidth = screenBytes*8 ; Max screenwidth = 512!!! +TankWidth = 8 ;---------------------------------------------- ; Player/missile memory PMGraph = $0800 ; real PM start = $0b00 diff --git a/grafproc.asm b/grafproc.asm index 2319ef6..76db853 100644 --- a/grafproc.asm +++ b/grafproc.asm @@ -1137,10 +1137,10 @@ FallingRight bvs EndRightFall ; we finish falling right if the tank reached the edge of the screen lda XtanksTableH,x - cmp #>(screenwidth-8-2) ; 2 pixels correction due to a barrel wider than tank + cmp #>(screenwidth-TankWidth-2) ; 2 pixels correction due to a barrel wider than tank bne @+ lda XtanksTableL,x - cmp #<(screenwidth-8-2) ; 2 pixels correction due to a barrel wider than tank + cmp #<(screenwidth-TankWidth-2) ; 2 pixels correction due to a barrel wider than tank @ bcs EndRightFall NotRightEdge ; tank is falling right - modify coorinates diff --git a/scorch.xex b/scorch.xex index 4f41980..d54baea 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/weapons.asm b/weapons.asm index eef94ca..5fb42cd 100644 --- a/weapons.asm +++ b/weapons.asm @@ -343,7 +343,7 @@ BurnedCheckLoop @ bcs TankOutOfFire ; let's calculate left edge of the fire - sbw xcircle #(napalmRadius+8+4-4) xdraw ; 10 pixels on left + character width (tank) + half character - correction + sbw xcircle #(napalmRadius+TankWidth+4-4) xdraw ; 10 pixels on left + character width (tank) + half character - correction bpl @+ mwa #0 xdraw ; left screen edge @ @@ -2623,10 +2623,10 @@ pressedRight jsr DrawTankNr mva #0 Erase lda XtankstableH,x - cmp #>(screenwidth-12) ; tank width correction +4 + cmp #>(screenwidth-TankWidth-4) ; tank width correction +4 bne @+ lda XtankstableL,x - cmp #<(screenwidth-12) ; tank width correction +4 pixels + cmp #<(screenwidth-TankWidth-4) ; tank width correction +4 pixels @ bcs RightScreenEdge inc XtankstableL,x sne:inc XtankstableH,x @@ -2686,10 +2686,10 @@ pressedSpace ; left or right from center of screen ? ldy #0 lda XtankstableH,x - cmp #>((screenwidth/2)-8) + cmp #>((screenwidth/2)-TankWidth) bne @+ lda XtankstableL,x - cmp #<((screenwidth/2)-8) + cmp #<((screenwidth/2)-TankWidth) @ bcc TankOnLeftSide TankOnRightSide dey @@ -2865,11 +2865,13 @@ CheckCollisionWithTankLoop lda xtankstableL,x cmp xdraw @ - bcs LeftFromTheTank ;add 8 double byte + bcs LeftFromTheTank + ; add 8 double byte ; now we use Y as low byte and A as high byte of checked position (right edge of tank) ; it is tricky but fast and much shorter clc - adc #8 + lda xtankstableL,x + adc #TankWidth tay lda xtankstableH,x adc #0 @@ -2910,7 +2912,7 @@ CheckCollisionWithShieldedTank bcs LeftFromTheTank tya ;add 16 double byte clc - adc #16 + adc #TankWidth+4+4 tay lda xtankstableH,x adc #0