; 1% * transmit game/level data
; 1% * get g/o signal (l&l) working
; 2% * send new peas' positions
; 1% * transmit game/level data
; 1% * get g/o signal (l&l) working
; 2% * send new peas' positions
- cp 2
- ld l,h ;hl=0 for peaworm and singleplayer
- jr nz,hi_
- ld a,(nrlevels+1)
- ld l,a ;skip peaworm slots for tron mode
-hi_:
- add hl,hl ;one WORD per hiscore
- and %01
- jr nz,sel_ownpea
- ld hl,(peaspos+2) ;2nd pea
-sel_ownpea:
- cal chkpeahit
- pop hl ;(peapos) 1st pea
- jp c,WormDead ;stopworm ;own pea hit
-
- ld a,e ;peek a (that's x86 asm for pop\push ;)
- and %01
- jp c,hitflag
-
-;no peas hit
- ld a,e
- cal flagtoken
- jp z,WormDead
- ld b,a ;%10
- srl b ;%01
- add a,b ;%11
+ jr c,hitflag
+;no peas hit:
+ ld a,e ;peek a (that's x86asm for pop\push ;)
+ bit 1,a ;%10 = carrying flag?
+ jp z,WormDead ;if not just die
+ xor %11 ;drop flag
- cal DrawPea ;restore own flag
- jr sillylabel ;inv both\die
+ psh af
+ cal WormDead
+ pop af ;which flag? (=and %1)
+ ld hl,drawctfpea1 ;restore #1
+ jr z,nottheotherflag
+ ld hl,drawctfpea2 ;restore #2
+nottheotherflag:
+ ld (hl),$E6 ;and nn
+ ret
- jr z,flagcaptured
- jr stopworm
+ jr nz,Drawworm ;flag taken, continue game
+ psh hl
+ ld de,20 ;flag captured+returned
+ cal IncScore
+ pop hl
+ ld a,$E6 ;and nn
+ ld (drawctfpea1),a ;redraw..
+ ld (drawctfpea2),a ;..both flags
+ jr Drawworm
gametron = 2
datatron: .db %1010100,1,1,1,-1, 0, 8, 0 ;Tron (SP; 1 live, cont.growth)
gamedeathm = 3 ;used
gametron = 2
datatron: .db %1010100,1,1,1,-1, 0, 8, 0 ;Tron (SP; 1 live, cont.growth)
gamedeathm = 3 ;used
-datadeathm: .db %1000001,3,2,1,-1,49, 8, 0 ;Deathmatch (3 lives, 50 growth)
+datadeathm: .db %1000000,3,2,1,-1,49, 8, 0 ;Deathmatch (3 lives, 50 growth)
gamefoodm = 4
datafoodm: .db %1100000,0,2,1,-1,-1, 8,10 ;Foodmatch (100 score)
gametimem = 5
gamefoodm = 4
datafoodm: .db %1100000,0,2,1,-1,-1, 8,10 ;Foodmatch (100 score)
gametimem = 5
.db %11110111,%00,-01,K_RIGHT,K_LEFT
worm1name: .db "WORMY ",0
worm2set: .dw worm2p,worm2p
.db %11110111,%00,-01,K_RIGHT,K_LEFT
worm1name: .db "WORMY ",0
worm2set: .dw worm2p,worm2p
- .db %11111011,%11,-01,K_F2,K_F1
+ .db %11111011,%01,-01,K_F2,K_F1
worm2name: .db "VIPER ",0
worm3set: .dw worm3p,worm3p
.db %11111011,%00,-01,K_COMMA,K_STO
worm3name: .db "NIBBLER ",0
worm4set: .dw worm4p,worm4p
worm2name: .db "VIPER ",0
worm3set: .dw worm3p,worm3p
.db %11111011,%00,-01,K_COMMA,K_STO
worm3name: .db "NIBBLER ",0
worm4set: .dw worm4p,worm4p
- .db %11111011,%00,-01,K_PLUS,K_ENTER
+ .db %11111011,%01,-01,K_PLUS,K_ENTER