From b2288323cde0474b43669f9c5805fa92191c75d6 Mon Sep 17 00:00:00 2001 From: Mischa Poslawsky Date: Fri, 17 Mar 2000 15:29:04 +0100 Subject: [PATCH] worm 0.83.0317: peaworm mode, bouncy balls, hiscore - peaworm mode like in the original game - hiscore saved in singleplayer games - line routine fixed at last - bouncing balls --- worm.asm | 403 +++++++++++++++++++++++++++++++------------------------ worm.txt | 112 ++++++++-------- 2 files changed, 277 insertions(+), 238 deletions(-) diff --git a/worm.asm b/worm.asm index 6c84154..d8f61e0 100644 --- a/worm.asm +++ b/worm.asm @@ -16,22 +16,18 @@ ;----------- 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 @@ -247,12 +243,14 @@ LetsGetThisPartyOn: 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 @@ -344,26 +342,39 @@ GameOver: 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 @@ -622,6 +633,8 @@ Delay: jr nz,Delay NoDelay: + call handlethatneatlittleball + ld ix,worm1 ld a,(nrworms) ld b,a @@ -660,7 +673,9 @@ WormDead: 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 @@ -670,31 +685,22 @@ removewormloop: 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 @@ -792,6 +798,29 @@ NoLinkIndic: 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 @@ -812,14 +841,6 @@ waitkey: ;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 @@ -829,7 +850,7 @@ NotNewHigh: adc a,0 call _SET_ABS_DEST_ADDR - xor a + xor a ld hl,start call _SET_ABS_SRC_ADDR ld hl,end-start @@ -955,14 +976,7 @@ notmoveY: ;bc=newpos 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 @@ -1101,13 +1115,7 @@ 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 @@ -1133,7 +1141,59 @@ res4pixels: 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 ----------- @@ -1144,8 +1204,8 @@ NewPea: 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 @@ -1155,12 +1215,12 @@ domult16: 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) @@ -1208,19 +1268,29 @@ DrawPeaPixel: ;-------- 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) @@ -1228,67 +1298,34 @@ CheckPixel: ;at bc in d 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 ----------- @@ -1333,9 +1370,7 @@ showstats: jr nz,showstatsS showstatloop: push bc -; push ix call showstat -; pop ix ld de,worm2-worm1 add ix,de ld hl,_penCol @@ -1389,6 +1424,10 @@ tilllevel9: ld a,123 ld (_penCol),a call showlives + ld a,(gameCar) + and _datafoodl + pop ix + ret z showleft: ld a,31 ld (_penCol),a @@ -1402,7 +1441,6 @@ Left =$-1 add a,'0' call __vputmap ld hl,txtLeft - pop ix __vputs: push ix call _vputs @@ -1448,9 +1486,6 @@ savestr: ;----------------------------- -offsets_table: - .db 128,64,32,16,8,4,2,1 - DisplayField: ld a,c sub 29 @@ -1686,10 +1721,10 @@ Line: ;draw line from de to hl (doptions) - .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 @@ -2239,13 +2282,15 @@ _datascore = %10000000 ;score>=100 limit 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 @@ -2256,7 +2301,7 @@ datadomin: .db %00000000 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 diff --git a/worm.txt b/worm.txt index 7efdcc2..06237b3 100644 --- a/worm.txt +++ b/worm.txt @@ -1,85 +1,79 @@ ############### 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 -- 2.30.0