git.shiar.nl
/
wormy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
worm 0.90.0503: ctf, example level file
[wormy.git]
/
worm.z80
diff --git
a/worm.z80
b/worm.z80
index 68d511288ab76a6dec170ca86b54971e81e7cb51..b4b4373104cca44d88adf7a46617005fb310b216 100644
(file)
--- a/
worm.z80
+++ b/
worm.z80
@@
-1001,6
+1001,16
@@
noboxes:
psh hl ; >> levelp new
cal showstats
psh hl ; >> levelp new
cal showstats
+ ld a,(Gametype)
+ cp gamectf
+ jr nz,noctf
+ ld hl,$1010
+ ld (peaspos),hl
+ cal DrawPea
+ ld hl,$2010
+ ld (peaspos+3),hl
+ cal DrawPea
+noctf:
ld a,(gameCar)
and _datafood
jr z,nofood
ld a,(gameCar)
and _datafood
jr z,nofood
@@
-1537,18
+1547,7
@@
Hitworm:
ld hl,0
PeaY =$-2
PeaX =$-1
ld hl,0
PeaY =$-2
PeaX =$-1
- ld a,(sprsize)
- inc a
- ld d,a
- ld a,b
- sub h
- inc a
- cp d ;=(sprsize)+1
- jp nc,WormDead
- ld a,c
- sub l
- inc a
- cp d
+ cal chkpeahit
jp nc,WormDead
cal DrawPea ;remove pea
ld a,(ix+grow)
jp nc,WormDead
cal DrawPea ;remove pea
ld a,(ix+grow)
@@
-1562,10
+1561,10
@@
peagrowth =$-1
ld de,10
cal IncScore
pop af
ld de,10
cal IncScore
pop af
- jp nz,
still_alive_not_dead
+ jp nz,
Drawworm ;continue
ld a,(gameCar)
and _datafoodl
ld a,(gameCar)
and _datafoodl
- jp z,
still_alive_not_dead
+ jp z,
Drawworm
ld a,(Gametype)
or a
jp nz,Exit ;stack restored
ld a,(Gametype)
or a
jp nz,Exit ;stack restored
@@
-1586,8
+1585,7
@@
peagrowth =$-1
pop hl ; << levelp new
jp StartLevel
pop hl ; << levelp new
jp StartLevel
-multiple_peas:
- ld hl,(peaspos)
+chkpeahit: ;hl=peapos
ld a,(sprsize)
inc a
ld d,a
ld a,(sprsize)
inc a
ld d,a
@@
-1595,14
+1593,49
@@
multiple_peas:
sub h
inc a
cp d ;=(sprsize)+1
sub h
inc a
cp d ;=(sprsize)+1
- jp nc,peaaction
+ ret nc ;nc=no pea
ld a,c
sub l
inc a
cp d
ld a,c
sub l
inc a
cp d
- ret c
-peaaction:
- ret
+ ret ;c=pea
+
+flagcaptured:
+ psh hl
+ ld de,30
+ cal IncScore
+ pop hl
+ cal WormDead
+DrawAllPeas:
+ ld hl,(peaspos)
+ cal DrawPea
+ ld hl,(peaspos+3)
+ jp DrawPea
+
+multiple_peas:
+ ld hl,(peaspos)
+ ld a,(ix+reserv)
+ ld e,a ;push a
+ and %01
+ jr nz,corrrectpea
+ ld hl,(peaspos+3)
+corrrectpea:
+ cal chkpeahit
+ jp nc,WormDead
+ ld a,e ;pop a
+ xor %01 ;0=1;1=0
+ ld (ix+reserv),a
+ and %01
+ add a,a
+ ld b,a
+ ld a,e
+ and %10
+ cp b
+ psh af ;safe z-flag
+ cal DrawPea ;remove
+ pop af
+ jr z,flagcaptured
+ jr Drawworm
;-----------------------------
;-----------------------------
@@
-1674,7
+1707,6
@@
previouspos =$+1
ld (ix+pos2),e
ld (ix+pos2+1),d
ret
ld (ix+pos2),e
ld (ix+pos2+1),d
ret
-still_alive_not_dead:
;-------- draw worm ----------
;-------- draw worm ----------
@@
-1885,8
+1917,7
@@
DrawPea: ;hl=(PeaY)
ld c,l
ld de,peasprite
spritepos =$-2
ld c,l
ld de,peasprite
spritepos =$-2
- cal PutSprite ;||-ed
- ret
+ jp PutSprite ;||-ed
;----------- score -----------
;----------- score -----------
@@
-2706,7
+2737,7
@@
_datafood = %00010000 ;food present
_________ = %00100000 ;
_datadie = %01000000 ;worm dies on impact
_datascore = %10000000 ;score>=100 limit
_________ = %00100000 ;
_datadie = %01000000 ;worm dies on impact
_datascore = %10000000 ;score>=100 limit
-_datamultpeas = 0
+_datamultpeas =
%0010000
0
gamesingle = 0
datasingle: .db %01011110
gamesingle = 0
datasingle: .db %01011110
@@
-2721,7
+2752,7
@@
datalinkm: .db %01000011
gamerace = 5
datarace: .db %10000000
gamectf = 6
gamerace = 5
datarace: .db %10000000
gamectf = 6
-datactf: .db %
010
00000
+datactf: .db %
111
00000
gamedomin = 7
datadomin: .db %01000000 ;==(8 modes)
gamedomin = 7
datadomin: .db %01000000 ;==(8 modes)
@@
-2732,10
+2763,10
@@
datalevels: .dw LevelDef, LevelDef
nrlevels: .db 2,2,2,2,2,2,2,2
worm1set: .dw worm1p,worm1p
nrlevels: .db 2,2,2,2,2,2,2,2
worm1set: .dw worm1p,worm1p
- .db %11110111,3,0,%01111110,%10,%100 ;< >
+ .db %11110111,3,
%0
0,%01111110,%10,%100 ;< >
worm1name: .db "worm #01",0
worm2set: .dw worm2p,worm2p
worm1name: .db "worm #01",0
worm2set: .dw worm2p,worm2p
- .db %11111011,3,
0
,%00111111,%10000,%1000 ;f1 f2
+ .db %11111011,3,
%11
,%00111111,%10000,%1000 ;f1 f2
worm2name: .db "worm #02",0
worm3set: .dw worm3p,worm3p
.db %11111011,3,0,%01011111,%10,%100 ;sto ,
worm2name: .db "worm #02",0
worm3set: .dw worm3p,worm3p
.db %11111011,3,0,%01011111,%10,%100 ;sto ,
@@
-2769,7
+2800,7
@@
storepos = 16
lives = 17
reserv = 18 ;loop
;race:lap
lives = 17
reserv = 18 ;loop
;race:lap
- ;
hunt:time
+ ;
ctf:pea
input = 19
left = 20
right = 21
input = 19
left = 20
right = 21