Randomize optimize :)

This commit is contained in:
Pecusx
2023-08-24 22:20:32 +02:00
parent 8fc08f2746
commit 08130aa714
8 changed files with 24 additions and 24 deletions
+4 -3
View File
@@ -58,8 +58,11 @@ NameScreen5
dta d" - Proceed "
.ENDIF
;-----------------------------------------------
OptionsSubTitle
dta d" Unknown Father of All Games"
;-----------------------------------------------
MoreUp
dta d" "
dta d" " ; common part of this text and OptionsSubTitle :)
dta 92,92,92
dta d" more "
dta 92,92,92
@@ -124,8 +127,6 @@ InventoryTitle
dta d"activate weapons"*
GameOverTitle2
dta d" Player Points Hits Earned Money "
OptionsSubTitle
dta d" Unknown Father of All Games "
;-----------------------------------------------------
;-------------display-lists---------------------------
;-----------------------------------------------------
+4 -3
View File
@@ -113,10 +113,11 @@
.endif
?rand
lda random
cmp #:1 ;floor
bcc ?rand
cmp #:2+1 ;ceiling
cmp #:2+1-:1 ;ceiling
bcs ?rand
.if %1>0 ; if floor = 0 - no add offset
adc #:1
.endif
.endm
;-------------------------------------
.macro phx
+4 -3
View File
@@ -134,10 +134,11 @@
.endif
?rand
lda random
cmp #:1 ;floor
bcc ?rand
cmp #:2+1 ;ceiling
cmp #:2+1-:1 ;ceiling
bcs ?rand
.if %1>0 ; if floor = 0 - no add offset
adc #:1
.endif
.endm
;-------------------------------------
.macro phx
+8 -9
View File
@@ -1722,9 +1722,9 @@ FastTank
jsr IsKeyPressed
bne MainTanksFloatingLoop ; neverending loop
mva #$00 ScrollFlag ; credits scroll off
jsr MakeDarkScreen
jmp GameOverResultsClear
; rts
jmp MakeDarkScreen
; jsr GameOverResultsClear
; rts
RandomizeTankPos
randomize 10 (32-7) ; 10 not 8 - barrel !! :)
sta Ytankstable,x
@@ -1743,14 +1743,13 @@ RandomizeTankPos
lda XtankOffsetGO_H,x
adc #0
sta XtankstableH,x
ldy #0
lda random
cmp #32 ; like 1:8
bcc NowFastTank
lda #0
sta ActiveDefenceWeapon,x
rts
NowFastTank
lda #1
bcs NowNotFastTank
iny
NowNotFastTank
tya
sta ActiveDefenceWeapon,x
rts
GameOverResultsClear