diff --git a/constants.asm b/constants.asm index 1beb554..9fffd44 100644 --- a/constants.asm +++ b/constants.asm @@ -285,7 +285,7 @@ WeaponPriceH ; weapons prices (tables with prices of weapons) .by >price_Battery________ .by >price_Bal_Guidance___ .by >price_Horz_Guidance__ - .by >price_Vert_Guidance__ + .by >price_Floating_Tank__ .by >price_Lazy_Boy_______ .by >price_Parachute______ .by >price_StrongParachute @@ -351,7 +351,7 @@ WeaponPriceL .by (screenwidth-10) ; tank width correction +2 + bne @+ + lda XtankstableL,x + cmp #<(screenwidth-10) ; tank width correction +2 +@ bcs RightScreenEdge + inc XtankstableL,x + sne:inc XtankstableH,x +RightScreenEdge + mva #25 AngleTable,x + ; then draw tank on new position + jsr DrawTankNr + jsr WaitOneFrame + jmp ReachSky + +pressedLeft + ; first erase old tank position + mva #1 Erase + jsr DrawTankNr + mva #0 Erase + lda XtankstableH,x + cmp #0 + bne @+ + lda XtankstableL,x + cmp #2 ; 2 pixles from left edge +@ bcc LeftScreenEdge + dec XtankstableL,x + lda XtankstableL,x + cmp #$ff + sne:dec XtankstableH,x +LeftScreenEdge + mva #155 AngleTable,x + ; then draw tank on new position + jsr DrawTankNr + jsr WaitOneFrame + jmp ReachSky + +pressedSpace + ;================================= + ;we shoot here!!! + jsr WaitForKeyRelease + mva #1 Erase + jsr DrawTankNr + mva #0 Erase + lda XtankstableL,x + and #%11111110 ; correction for PM + sta XtankstableL,x +GoDown + mwa #mountaintable temp + clc + lda temp + adc XtankstableL,x + sta temp + lda temp+1 + adc XtankstableH,x + sta temp+1 + adw temp #4 ; center of the tank + ldy #0 + lda (temp),y + sta FloatingAlt +FloatDown + lda ytankstable,x + cmp FloatingAlt + beq OnGround + ; first erase old tank position + mva #1 Erase + jsr DrawTankNr + mva #0 Erase + inc ytankstable,x + ; then draw tank on new position + jsr DrawTankNr + jsr WaitOneFrame + jmp FloatDown +OnGround + + rts +.endp + ; ------------------------------------------------- .proc CheckCollisionWithTank ; -------------------------------------------------