Walls added! #50

And Battery activation fix :)
This commit is contained in:
Pecusx
2022-08-22 19:27:02 +02:00
parent 18dfe4a725
commit 7f85a7ed6a
8 changed files with 78 additions and 8 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
; initial values for some variables
initialvaluesStart
I_OptionsTable .by 0,1,2,2,0,1,3,2
I_OptionsTable .by 0,1,2,2,0,1,3,2,0
I_RoundsInTheGame .by 10 ;how many rounds in the current game
I_seppukuVal .by 75
I_mountainDeltaH .by 3
+1 -1
View File
@@ -17,7 +17,7 @@ display = $1010 ;screen takes $2K due to clearing routine
margin = 40 ;mountain drawing Y variable margin
MaxPlayers = 6
maxOptions = 8 ;number of all options
maxOptions = 9 ;number of all options
PMOffsetX = $2C ; P/M to graphics offset
PMOffsetY = $23 ; P/M to graphics offset
napalmRadius = 10
+1
View File
@@ -17,6 +17,7 @@ OptionsHere
dta d"Missiles : slug slow norm fast hare "
dta d"Seppuku : nevr rare norm oftn alws "
dta d"Mountains: NL BE CZ CH NP "
dta d"Walls : none wrap bump boxy rand "
OptionsScreenEnd
;-----------------------------------------------
ListOfWeapons
+20 -2
View File
@@ -219,7 +219,7 @@ FirstSTART
START
; Startup sequence
jsr Initialize
;jsr GameOverScreen ; only for test !!!
lda #song_main_menu
@@ -242,6 +242,7 @@ START
; for the round #1 shooting sequence is random
MainGameLoop
jsr SetWallsType
; first set default barrel lengths (fix for Long Schlong activation :) )
; we must do it before purchase/activate
ldx #(MaxPlayers-1)
@@ -1508,7 +1509,24 @@ nextishigher
rts
.endp
;--------------------------------------------------
.proc SetWallsType
;--------------------------------------------------
mva #0 WallsType
lda OptionsTable+8
cmp #4
beq SetRandomWalls
lsr
ror WallsType
lsr
ror WallsType
rts
SetRandomWalls
lda random
and #%11000000
sta WallsType
rts
.endp
;--------------------------------------------------
.proc GetKey ; waits for pressing a key and returns pressed value in A
; when [ESC] is pressed, escFlag is set to 1
BIN
View File
Binary file not shown.
+3 -1
View File
@@ -204,7 +204,7 @@ OptionSetLoop
; next option
adw temp #40 ;jump to next line
inc:lda temp2
cmp #maxoptions ;number of options
cmp #maxOptions ;number of options
bne OptionsSetMainLoop
;inversing the first few chars of the selected line (OptionsY)
@@ -853,7 +853,9 @@ invSelectDef
; if activate battery, we do it differently
mva #sfx_battery sfx_effect
mva #99 Energy,x
phy
jsr MaxForceCalculate
ply
jmp DecreaseDefensive ; bypass activation
NotBattery
cmp #ind_Long_Barrel____
+3 -2
View File
@@ -29,7 +29,7 @@ skilltable ; computer controlled players' skills (1-8), 0 - human (no cleaning
;----------------------------------------------------
variablesToInitialize
;Options DO NOT ZERO ON RESTART GAME - ticket #27
OptionsTable .by 0,1,2,2,0,1,3,2
OptionsTable .by 0,1,2,2,0,1,3,2,0
RoundsInTheGame .by 10 ;how many rounds in the current game
seppukuVal .by 75
mountainDeltaH .by 3
@@ -138,7 +138,8 @@ MaxWind .ds 1 ;
WindOrientation .DS 1 ;(0-right,1-left)
;----------------------------------------------------
;Counter .DS 1 ;temporary Counter for outside loops
;HitFlag .DS 1 ;$ff when missile hit ground, $00 when no hit, $01-$06 tank index+1 when hit tank
;HitFlag .DS 1 ;$ff when missile hit ground, $00 when no hit, $01-$06 tank index+1 when hit tank
WallsType .ds 1 ; bits 6 and 7: 00 - none, 01 - bump, 10 - wrap, 11 - boxy
;----------------------------------------------------
xtankstableL ;X positions of tanks (lower left point)
.DS [MaxPlayers]
+49 -1
View File
@@ -1798,6 +1798,12 @@ NoWind
mwa ytraj+1 ybyte
jsr draw
;key
bit LaserFlag
bmi LaserNoWalls
; Check for walls
jsr MakeWalls
;
LaserNoWalls
mwa xtraj+1 XtrajOld+1
mwa ytraj+1 YtrajOld+1
@@ -2333,7 +2339,49 @@ MIRValreadyAll
;jsr drawtanks
rts
.endp
; -------------------------------------------------
.proc MakeWalls
; -------------------------------------------------
bit WallsType ; ; bits 6 and 7: 00 - none, 01 - bump, 10 - wrap, 11 - boxy
bpl WrapAndNone
bvc MakeBump
; top bounce
bit ytraj+2
bpl NoOnTop
sec
.rept 4
lda #$00
sbc vy+#
sta vy+#
.endr
NoOnTop
MakeBump
cpw xtraj+1 #screenwidth
bcc OnScreen
; inverse vx (bouncing wall)
sec
.rept 4
lda #$00
sbc vx+#
sta vx+#
.endr
rts
WrapAndNone
bvc NoWall
cpw xtraj+1 #screenwidth
bcc OnScreen
; (wrapping wall)
bit xtraj+2
bmi LeftWrap
RightWrap
sbw xtraj+1 #screenwidth
rts
LeftWrap
adw xtraj+1 #screenwidth
OnScreen
NoWall
rts
.endp
; -------------------------------------------------
.proc WhiteFlag
; -------------------------------------------------