;----------- TO-DO -----------
;-----------------------------
-; Shiar 4.II.00
+; Shiar 3.III.00
;Feel like doing something? (name indicates who's working on it)
-; * linkplay TESTING! (+faster)
+; * linkplay
; * singleplay ending
; * titlescreen
; * make linkplay available for all gametypes (not just deathmatch)
; * two worms collide with heads -> both should die
-; * bouncing balls :)
; * game types:
;1) * ctf: take enemy flag (right-bottom) and return to your flag (left-top)
;1) * domination?: take control points by running over them and hold them
-; * AI worms?
;1)* sprites for picks instead of blocks
-; * fix linedraw procedure
-; * save hiscore
;1) Working on a new pickup-system allowing more than one "food" and different pickup-handling
ld hl,gamesdata
add hl,de
- or a
- jr nz,notsingle
- inc a
+ ld a,(hl)
+ push af
+ and _datasingl
+ jr z,notsingle
+ ld a,1
ld (nrworms),a
notsingle:
- ld a,(hl)
+ pop af
ld (gameCar),a
push af
pop de
StartLevel:
- ld a,(de)
- ld (Left),a
- inc de
- ld a,(de)
- ld (Speed),a
- inc de
- ld a,(de)
+ ex de,hl
+ ld de,Left
+ ldi
+ ld de,Speed
+ ldi
+ ld a,(hl)
ld (worm1+grow),a
ld (worm2+grow),a
ld (worm3+grow),a
ld (worm4+grow),a
- inc de
+ ld (beginsize),a
+ inc hl
+
+ ld a,(hl)
+ inc hl
+ ld (nrballs),a
+ or a
+ jr z,toobad_noballs
+ ld de,ballpos
+ ldi
+ ldi
+toobad_noballs:
+#ifdef 0
ld a,(gameCar)
and _datahunt
jr z,nohunter
ld a,huntersize
ld (worm2+grow),a
nohunter:
+#endif
+ ex de,hl
ld (thislevel),de
push de
ld hl,worm1set
jr nz,Delay
NoDelay:
+ call handlethatneatlittleball
+
ld ix,worm1
ld a,(nrworms)
ld b,a
ld h,(ix+tail+1)
ld l,(ix+tail)
- push hl
+ ld d,(ix+head+1)
+ ld e,(ix+head)
+ jr DoesWormTailEqualsWormHead ;chk4 size=0
removewormloop:
ld c,(hl)
inc hl
push hl
call res4pixels
pop hl
- ld a,(ix+head)
- cp l
- jr nz,removewormloop
- ld a,(ix+head+1)
- cp h
+ inc (ix+grow)
+DoesWormTailEqualsWormHead:
+ call _cphlde
jr nz,removewormloop
- ;hl=ix+head
- pop de ;ix+tail
ld a,(gameCar)
- and _datamulti
+ and _datasingl
jr nz,safewormsizedone
-; or a
- sbc hl,de
- ld a,l
- rr h
- rra
- inc a
+ ld a,0
+beginsize =$-1
ld (ix+grow),a
safewormsizedone:
- ld h,(ix+head+1)
- ld l,(ix+head)
- ld (ix+tail+1),h
- ld (ix+tail),l
+ ;de=ix+head
+ ld (ix+tail+1),d
+ ld (ix+tail),e
ld a,50
ld (ix+delay),a
pop bc
djnz displayWormStats
+ ld a,(gameCar)
+ and _datasingl
+ jr z,hiscorecheckdone
+checkhiscore:
+ ld de,(worm1+score)
+HiScore =$+1
+ ld hl,0
+ ld a,e
+ cp l
+ jr c,NotNewHigh
+ ld a,d
+ cp h
+ jr c,NotNewHigh
+ ld (HiScore),de
+ ex de,hl ;disp.new hiscore
+NotNewHigh:
+ ex de,hl
+ ld hl,txthiscore
+ call _puts
+ ex de,hl
+ call showHL
+hiscorecheckdone:
+
waitkey:
halt
halt
;8Snaky @ 00 04820
ExitNoStats:
-; ld a,(Eaten)
- xor a
- ld hl,HiScore
- cp (hl)
- jr c,NotNewHigh
- ld (hl),a
-NotNewHigh:
-
ld hl,_asapvar
rst 20h ;_ABS_MOV10TOOP1
rst 10h ;_FINDSYM
adc a,0
call _SET_ABS_DEST_ADDR
- xor a
+ xor a
ld hl,start
call _SET_ABS_SRC_ADDR
ld hl,end-start
xor 3
ld d,a
GotFour:
- call CheckPixel
- inc b
- call CheckPixel
- inc c
- call CheckPixel
- dec b
- call CheckPixel
- dec c
+ call chk4pixels
rl d
jp nc,Drawworm
ld (ix+head),l
ld (ix+head+1),h
- call SetPixel
- inc b
- call SetPixel
- inc c
- call SetPixel
- dec b
- call SetPixel
+ call set4pixels
ld a,(ix+grow)
dec a
inc c
call ResPixel
dec b
- jp ResPixel
+ResPixel:
+ call FindPixel
+ cpl
+ and (hl)
+ ld (hl),a
+ ret
+
+;-----------------------------
+;---------- ball -------------
+;-----------------------------
+
+handlethatneatlittleball:
+ ld a,0
+nrballs =$-1
+ or a
+ ret z
+ballpos =$+1
+ ld bc,$0503
+ call res4pixels
+ dec c
+ ld e,b
+ballxmove:
+ inc b ;=%000100 dec=%000101
+ call checkballhit
+ jr z,ballxdone
+ ld b,e
+ ld hl,ballxmove
+ call letsmovetheotherway
+ballxdone:
+ ld e,c
+ballymove:
+ inc c ;=%001100 dec=%001101
+ call checkballhit
+ jr z,balldone
+ ld c,e
+ ld hl,ballymove
+ call letsmovetheotherway
+balldone:
+ ld (ballpos),bc
+ jp set4pixels
+
+letsmovetheotherway:
+ ld a,1
+ xor (hl)
+ ld (hl),a
+ ret
+
+checkballhit:
+ ld d,0
+ call chk4pixels
+ xor a
+ cp d
+ ret
;-----------------------------
;----------- procs -----------
ld hl,0
ld de,12345
Seed =$-2
- ld a,7921 & 255
- ld bc,1000h+(7921/256)
+ ld a,7921&255
+ ld bc,$1000+(7921/256)
domult16:
add hl,hl
rla
noadd16:
djnz domult16
inc hl
- ld (Seed),hl ;seed=(seed*7921+1) MOD 65536
+ ld (Seed),hl ;seed=(seed*7921+1)\65536
ld a,(FieldWidth)
add a,123
cp h
- jr c,NewPea
+ jr c,NewPea
inc h
inc h
ld a,(FieldHeight)
;-------- pixelprocs ---------
-ResPixel: ;at bc
- call FindPixel
- cpl
- and (hl)
- ld (hl),a
- ret
-
+set4pixels:
+ call SetPixel
+ inc b
+ call SetPixel
+ inc c
+ call SetPixel
+ dec b
SetPixel: ;at bc
call FindPixel
or (hl)
ld (hl),a
ret
+chk4pixels: ;&&
+ call CheckPixel
+ inc b
+ call CheckPixel
+ inc c
+ call CheckPixel
+ dec b
+ call CheckPixel
+ dec c
+ ret
CheckPixel: ;at bc in d
call FindPixel
and (hl)
dec d
ret
-;------------------------------------------------------
-; CLEM's FIND_PIXEL
-; by Clem
-;
-; 131 cycles 28 bytes (b,c) to hl:a destroyes: none
-;------------------------------------------------------
+;CLEM's FIND_PIXEL (131 cycles; 28 bytes)
+; (b,c) to hl:a; destroyes: -)
FindPixel:
- ld h,ScrBuffer/$800
- ld a,c
- add a,a
- add a,a
- ld l,a ;hl=$3f00+4*y
- ld a,b
- rra
- add hl,hl
- rra
- add hl,hl ;hl=$fc00+16*y
- add hl,hl
- rra ;a=x/8
- or l
- ld l,a
- ld a,b
- and 7
- cpl
- rlca
- rlca
- rlca
- ld (FP_Bit),a
- xor a
-FP_Bit =$+1
- set 0,a
- ret
-
-;FindPixel: ;bc to ahl + de gone
- push de
- push bc
- ld a,b
- and 7
- add a,offsets_table & 255
- ld e,a
- ld d,offsets_table/256
- ld h,0
- ld l,c
- add hl,hl ;2y
- add hl,hl ;4y
- add hl,hl ;8y
- add hl,hl ;16y
- add hl,hl ;32y
+ ld h,ScrBuffer/$800
+ ld a,c
+ add a,a
+ add a,a
+ ld l,a ;hl=4*y + offset/8
ld a,b
- and %11111000
- rra
rra
+ add hl,hl
rra
+ add hl,hl
+ add hl,hl ;hl=32*y + offset
+ rra ;a=x/8
or l
ld l,a
- ld a,(de)
- ld de,ScrBuffer
- add hl,de
- pop bc
- pop de
+ ld a,b
+ and 7
+ cpl
+ rlca
+ rlca
+ rlca
+ ld (FP_Bit),a
+ xor a
+FP_Bit =$+1
+ set 0,a
ret
;----------- score -----------
jr nz,showstatsS
showstatloop:
push bc
-; push ix
call showstat
-; pop ix
ld de,worm2-worm1
add ix,de
ld hl,_penCol
ld a,123
ld (_penCol),a
call showlives
+ ld a,(gameCar)
+ and _datafoodl
+ pop ix
+ ret z
showleft:
ld a,31
ld (_penCol),a
add a,'0'
call __vputmap
ld hl,txtLeft
- pop ix
__vputs:
push ix
call _vputs
;-----------------------------
-offsets_table:
- .db 128,64,32,16,8,4,2,1
-
DisplayField:
ld a,c
sub 29
push hl
push de
ld a,d
-; cp h
-; jr c,lineOrdered
-; ex de,hl
-lineOrdered:
+ cp h
+ jr c,lineOrdered
+ ex de,hl
+lineOrdered:
ld b,d
ld c,e
push hl
jr DoneLine
LineNotPoint:
sub h
- ld de,16
+ ld de,32
jr nc,LinePositiveY
neg
- ld de,-16
-LinePositiveY:
+ ld de,-32
+LinePositiveY:
cp b
jr nc,SteepLine
add a,a
ld a,h
sub b
pop hl
-LineLoopGentle:
+LineLoopGentle:
push af
ld a,(hl)
or c
rrc c
jr nc,$+3
inc hl
- pop af
+ pop af
jp m,line2sm
line1sm:
add a,0
sub h
ld b,h
pop hl
-LineLoopSteep:
+LineLoopSteep:
push af
ld a,(hl)
or c
;-----------------------------
LevelsDM:
-
- .db 8,5,15
+ .db 8,5,15,0
.db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
.db 128,57
.db 0,0
LevelsDM2:
-
- .db 8,5,31
+ .db 8,5,31,0
.db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
.db 128,57
.db 0
.db 4,19,80,34
LevelsR:
- .db 8,5,24
+ .db 8,5,24,0
.db $40,3,2,$40,6,2, $40,9,2,$40,12,2
.db 128,57
.db 0
.db 8,29,32,20
LevelsH:
-
- .db 8,5,5
+ .db 8,7,17,0
+#ifdef 0
huntersize = 31
+#endif
.db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
.db 128,57
.db 0
.db 4,19,16,34
.db 4,19,80,34
-NUM_LEVELS = 9
+NUM_LEVELS = 10
LevelsS:
- .db 5,4,15 ;peas,speed,begin_size
+ .db 4,5,10,1 \ .dw $20F
+ .db 0,2,63
+ .db 128,57
+ .db 2
+ .db 28,14,100,41
+ .db 28,41,100,14
+ .db 0
+
+ .db 5,4,15,0 ;peas,speed,begin_size,balls
.db 0,2,63 ;d,y,x
.db 128,57 ;field width, height
.db 0 ;no additional lines
.db 0 ;no boxes
- .db 8,4,15
+ .db 8,4,15,0
.db $40,14,2
.db 128,57
.db 1
.db 28,28,100,28 ;line coords: x1,y1,x2,y2
.db 0
- .db 9,4,15
+ .db 9,4,15,0
.db $40,8,2
.db 128,57
.db 2
.db 28,41,100,41
.db 0
- .db 9,3,15
+ .db 9,3,15,0
.db $40,8,2
.db 128,80
.db 2
.db 20,40,108,40
.db 0
- .db 10,3,15
+ .db 10,3,15,0
.db 2,8,$40
.db 128,90
.db 3
.db 18,45,110,45
.db 0
- .db 7,3,15
+ .db 7,3,15,0
.db 64,4,0
.db 128,86
.db 6
.db 110,20,110,64
.db 0
- .db 9,2,15
+ .db 9,2,15,0
.db 4,10,$40
.db 128,82
.db 3
.db 0,60,74,60
.db 0
- .db 12,2,15
+ .db 12,2,15,0
.db 64,4,0
.db 128,90
.db 6
.db 74,72,110,72
.db 0
- .db 8,2,15
+ .db 8,2,15,0
.db 72,52,$c0
.db 128,128
.db 13
.db "by Shiar",0
txtOptions: .db "Options",0
txtGame: .db "Singleplayer",0 ;0
-txtGame2: .db "Deathmatch ",0 ;1
- .db "Foodmatch ",0 ;2
- .db "LinkMatch",0 ;3 (>options)
- .db "Hunting ",0 ;4
- .db "Race ",0 ;5
- .db "CTF ",0 ;6
- .db "Domination",0 ;7
+txtGame2: .db "Peaworm ",0 ;1
+ .db "Deathmatch",0 ;2
+ .db "Foodmatch ",0 ;3
+ .db "LinkMatch",0 ;4 (>options)
+ .db "Hunting ",0 ;5
+ .db "Race ",0 ;6
+ .db "CTF ",0 ;7
+ .db "Domination",0 ;(>=8)
txtWaiting: .db "Waiting...",0
txtReceive: .db "Receiving...",0
WormVersion = 092
-WormMsg: .db "WORM by SHIAR -- test version",0
-txtLevel: .db "Level ",0
-txtWorms: .db "Worms: 0",0 ;follows txtLevel
-txtDied: .db "Died ",0
-txtScore: .db "Score",0 ;follows txtDied
-txtLeft: .db " left",0 ;follows txtScore
-txtReady: .db "Prepare!",0
+WormMsg: .db "WORM by SHIAR -- test version",0
+txtLevel: .db "Level ",0
+txtWorms: .db "Worms: 0",0 ;follows txtLevel
+txtDied: .db "Died ",0
+txtScore: .db "Score",0 ;follows txtDied
+txtLeft: .db " left",0 ;follows txtScore
+txthiscore:.db "HiScore:",0
+txtReady: .db "Prepare!",0
txtposReady = 7
-txtGO: .db "----- GAME OVER -----",0
-HiScore: .db 0
+txtGO: .db "----- GAME OVER -----",0
gamesdata:
_datalink = %00000001
-_datamulti = %00000010
+_datasingl = %00001000 ;singleplayer=1
_datalivel = %00000010 ;ix+lives=0 limit
_datafoodl = %00000100 ;left=0 limit
_datanextl = %00001000 ;next level if left=0
datasingle: .db %00011110
.dw LevelsS
+datapeas: .db %00011010
+ .dw LevelsS
datadeathm: .db %00000010
.dw LevelsDM2
datafoodm: .db %10010000
.dw LevelsDM
datalinkm: .db %00000011
.dw LevelsDM
-datahuntin: .db %00110100
+datahuntin: .db %10100000
.dw LevelsH
datarace: .db %11000000
.dw LevelsR
setdata = 18
-resbit = 2 ;and%11111011
+resbit = 2 ;and%11111011
worm1set: .dw $B000,$B000 ;%10110000
.db 3,0,%01111110,%10,%100 ;< >
.db "Worm #1",0
###############
Title : ### W O R M ###
###############
- Version : 0.92.211
- Author : SHIAR
+ Version : 0.92
+ Release Date : soon
File(s) : worm.86p (4kb) + worm.txt
- Release Date : ~ april 2000 (I hope)
+ Author : Shiar
Email Address : shiar@mailroom.com
ICQ UIN : #43840958
Web Page : www.games3.net/shiar
- Description : Nibbles-like game, 1-4 players.
- Where to get this game : games3.net/shiar (home of Worm) or ticalc.org
+ Description : Nibbles-like game
+ Where to get this game : games3.net/shiar (home of Worm)
Other games by author : Nemesis (beta)
- Additional Credits to : Matthew Shepcar and Jonah Cohen
+ Additional Credits to : Matthew Shepcar (wrote original Peaworm)
+ Jonah Cohen (wrote some parts of Worm)
-GENERAL =------------------------------------------------------------------
-Avoid your worm from crashing by it turning left/right. The controls are:
+GENERAL
+Avoid your worm from crashing by it turning left/right. The controls are:
1) left/right 2) F1/F2 3) sto/, 4) enter/+
- EXIT : exits to the stats-screen
- MORE : turns your calc off (pauses)
-GRAPH : teacher key (not made yet)
+EXIT : exits to the stats-screen.
+MORE : turns your calc off (pauses).
-STATS-SCREEN =-------------------------------------------------------------
-At the end of each game, the stats-screen will be displayed. It shows the
-score and deaths for each worm. Hit enter to return to the main menu.
+STATS-SCREEN
+At the end of each game, the stats-screen will be displayed. It shows
+the score and deaths for each worm. Hit enter to return to the main menu.
-SINGLEPLAYER =-------------------------------------------------------------
-Move your worm over the "food". When you ate enough food you advance to the
-next, more difficult, level.
-On the top of the screen you can see in which level you are, how many peas
-you still have to eat, your score and your lives left.
+SINGLEPLAYER
+Move your worm (left/right) over the "food". When you ate enough food
+you advance to the next, more difficult, level.
+On the top of the screen you can see in which level you are, how many
+peas you still have to eat, your score and your lives left.
-DEATHMATCH =---------------------------------------------------------------
-A multiplayer game where you have to kill the other worm(s) before they
-kill you. When you have no lives left, the game ends. The number of lives
-left for each player are displayed on the top of the screen. You can play
+PEAWORM
+Get as many peas possible in a single level.
+
+DEATHMATCH
+A multiplayer game where you have to kill the other worm(s) before they
+kill you. When you have no lives left, the game ends. The number of lives
+left for each player are displayed on the top of the screen. You can play
with 2-4 humans.
-FOODMATCH =----------------------------------------------------------------
-Like deathmatch, with the difference that your objective is to score 100
-points. You'll get 10 points for taking a pea, if you die however, you lose
-10.
+FOODMATCH
+Like deathmatch, with the difference that your objective is to score 100
+points. You'll get 10 points for taking a pea, if you die however, you
+lose 10.
-HUNTING =------------------------------------------------------------------
-In hunting, the hunter (player 1) has to "catch" the prey (2). The hunter
-must hit the prey with his head, killing the prey and scoring 10 points.
-However, the prey gains 5 points for every 250 turns he's alive. The first
+HUNTING
+In this game, the hunter (player 1) has to "catch" the prey (2). The hunter
+must hit the prey with his head, killing the prey and scoring 10 points.
+However, the prey gains 5 points for every 250 turns he's alive. The first
one scoring 100 points wins.
-RACE =---------------------------------------------------------------------
-In this gametype, all worms have to move around like race-cars. The first
+RACE
+In this gametype, all worms have to move around like race-cars. The first
one to complete 3 laps wins.
-CTF =----------------------------------------------------------------------
-Each player has to capture the enemy flag, and return it to his own flag.
-
-DOMINATION =---------------------------------------------------------------
-There are several control points which you have to control (by running over
-them). Every ten turns each player is given one point for each control
-point he/she controls. The first one scoring 100 points wins.
+CTF
+Each player has to capture the enemy flag, and return it to its own flag.
-OF COURSE =----------------------------------------------------------------
-I am not responisble for any damage Worm causes. Furthermore, you may not
-release an altered version of Worm, distribute it without this readme file
-included, nor may you charge money for it.
+DOMINATION
+There are several control points which you have to control. Every ten turns
+each player is given one point for each control point he/she controls.
+The first one scoring 100 points wins.
-HISTORY =------------------------------------------------------------------
-This is a historical overview of Worm (facts may not match reality)
-* End 1998: Matthew Shepcar released Peaworm, worm in it's simplest form
-* Matt didn't release another version with levels and vertical scrolling
-* End 1999: I (Shiar) asked him whether I could complete Worm
-* Jonah Cohen helped me for a while, but he either died or got bored
-* 4/2000: Shiar completed Worm and the program looked worse than ever
+CLAIMER
+I will take full responsabilty of any damage this program does to
+either you, your calc, pets, relationship, etc...
+JUST KIDDING!
-CREDITS =------------------------------------------------------------------
-This game was made by SHIAR. Please contact me at shiar@mailroom.com, or
-ICQ UIN #43840958. Also visit the home of Worm at www.games3.net/shiar
-(come.to/shiar) for the latest news about Worm and other games by me.
+CREDITS
+This game was made by SHIAR. Please contact me at shiar@mailroom.com, or
+ICQ UIN #43840958.
+Also visit the home of Worm at www.games3.net/shiar (come.to/shiar) for the
+latest news about Worm and other games by me.
Matthew Shepcar - for writing the original Peaworm
-Jonah Cohen - wrote some parts of Worm
-Free Bird - calc2calc linkplay testing
-JQL - betatesting
+Jonah Cohen - wrote some parts of Worm
-.
+.
\ No newline at end of file