Jump to content
IGNORED

Zombies In the Swamp (XB)


InfernalKeith

Recommended Posts

I've decided to go backwards a little bit in my BASIC programming, and start keying in some old type-in programs from books to study how they work and see what I can learn. Right off the bat, with the very first program I entered, I got some good lessons.

 

This game is called "Zombies in the Swamp," from the book "Terrific Games For the TI 99/4A" by Hal Renko and Sam Edwards. You are laying tiles ("rafts") across a swamp and crossing to the other side, but occasionally a zombie will rise from the murk and run across your tiles. Once it runs back off the other side, that spot is blocked and future zombies will have to go somewhere else -- more than likely, close to you -- before they can run back into the swamp. It becomes an interesting exercise to see how straightforward you can make your trip across the swamp, without leaving too easy a path for zombies to run right up and catch you.

 

Obviously, the presentation is bare-bones, but there is a lot of potential here. For me, the inspiration lies in the use of the true and false flags in lines 350, 450, 500, 520, and 570. I have several half-finished games where I got hung up on the movement of a computer-controlled character -- this example has given me ideas on how to efficiently test for various outcomes and get my AI character to move toward a target while avoiding obstacles.

 

Anyway, since I did the keying in already, I figured I'd share. I'm gonna work my way through this book for a while before I go back to my own projects, and try to "warm up" since my head hasn't been in programming mode much recently. I think this'll be a fun way to get the gears moving again.

 

Hope you're all doing well!

 

Keith

 

 

10 REM ZOMBIES IN THE SWAMP
20 CALL CLEAR
30 DIM MA(11,16,2)
40 RANDOMIZE
50 CALL CHAR(120,"00667E187E818166")
60 CALL CHAR(130,"18183C5A993C2466")
70 CALL CHAR(140,"FFFFFFFFFFFFFFFF")
80 CALL CHAR(110,"0000001818000000")
90 MA(10,15,1)=1
100 CALL COLOR(0,4,4) :: CALL COLOR(12,7,12)
110 CALL COLOR(13,2,16) :: CALL COLOR(14,16,6)
120 CALL COLOR(10,2,4)
130 FOR R=1 TO 10
140 CALL HCHAR(5+R,6,30,15)
150 NEXT R
160 CALL HCHAR(15,20,130)
170 X=10 :: Y=15
180 D$(1)="MOVE OR THROW?(M OR T)"
190 D$(2)="MOVE TO THE..?"
200 D$(3)="THROW TO THE..?"
210 DISPLAY AT(20,3)BEEP:D$(1)
220 REM INPUT
230 CALL KEY(3,K,S) :: IF S=0 THEN 230
240 IF K<>77 AND K<>84 THEN 230
250 ON INT(K/16)-3 GOSUB 300,410
260 TURNS=TURNS+1
270 IF RND<.4 AND TURNS>6 THEN GOSUB 480
280 GOTO 210
290 REM MOVE *****
300 DISPLAY AT(20,3)BEEP:D$(2)
310 CALL KEY(3,K,S) :: IF S=0 THEN 310
320 TX=X-(K=83)+(K=78)
330 TY=Y-(K=69)+(K=87)
340 IF TX=0 AND TY=1 THEN PRINT "YOU SUCCEEDED," :: PRINT "CONGRATULATIONS" :: END
350 IF(TX>10)+(TX<1)+(TY>15)+(TY<1)<>0 THEN 390
360 CALL HCHAR(X+5,Y+5,140) :: CALL HCHAR(TX+5,TY+5,130)
370 X=TX :: Y=TY
380 IF MA(X,Y,0)=0 THEN PRINT "YOU DROWNED." :: END
390 RETURN
400 REM THROW *****
410 DISPLAY AT(20,3)BEEP:D$(3)
420 CALL KEY(3,K,S) :: IF S=0 THEN 420
430 TX=X-(K=83)+(K=78)
440 TY=Y-(K=69)+(K=87)
450 IF(TX>10)+(TX<1)+(TY>15)+(TY<1)=0 THEN CALL HCHAR(TX+5,TY+5,140) :: MA(TX,TY,0)=1
460 RETURN
470 REM MONSTER MOVE *****
480 X1=10 :: Y1=15
490 K=INT(RND*6)
500 TX1=X1+(K=1)-(K=2)+(K=4) :: TY1=Y1+(K=3)-(K=0)+(K=5)
510 IF TX1=X AND TY1=Y THEN PRINT "YOU HAVE BEEN EATEN!" :: END
520 IF(TX1>10)+(TX1<1)+(TY1>15)+(TY1<1)<>0 THEN 490
530 IF MA(TX1,TY1,0)=1 THEN CALL HCHAR(X1+5,Y1+5,140) :: CALL HCHAR(TX1+5,TY1+5,120) :: X1=TX1 :: Y1=TY1 :: IF RND<.7 THEN 500 ELSE 490
540 BOL=0
550 FOR C1=-1 TO 1
560 FOR C2=-1 TO 1
570 IF ABS(C1)<>ABS(C2)THEN BOL=BOL+(MA(X1+C1,Y1+C2,1)=1)
580 NEXT C2
590 NEXT C1
600 IF BOL=-3 THEN MA(X1,Y1,1)=1 :: MA(X1,Y1,0)=0
610 IF MA(TX1,TY1,1)=1 THEN 490
620 MA(TX1,TY1,1)=1 :: CALL HCHAR(X1+5,Y1+5,140) :: CALL HCHAR(TX1+5,TY1+5,110)
630 RETURN

Link to comment
Share on other sites

I have a copy of this book... it's a pretty good one. At least it has graphics; I always disliked the "games" books that had nothing but text games, obviously converted from other platforms.

 

I still have all my old TI books... they're mostly worthless to anyone who isn't a 99'er, and I'd definitely get some odd looks if I tried taking them in to Half-Price.

 

Adamantyr

Link to comment
Share on other sites

I have a copy of this book... it's a pretty good one. At least it has graphics; I always disliked the "games" books that had nothing but text games, obviously converted from other platforms.

 

I still have all my old TI books... they're mostly worthless to anyone who isn't a 99'er, and I'd definitely get some odd looks if I tried taking them in to Half-Price.

 

Adamantyr

 

Did you ever get that traffic control game to work? I never did.

Also, did you spend numerous hours typing in that huge IT text adventure game?

Link to comment
Share on other sites

Ebay's probably the only way to get much out of the old TI books. I actually started doing this because I was debating selling off a lot of my books -- I've been saving a bunch of TI, Commodore Vic 20 and 64, and various other interesting programming books for years now, but never really using them. I decided to keep them and try to get some use out of them, rather than let the knowledge out of my grasp for a few bucks a pop -- after all, it's not like they're eating anything, and I have room to keep them. I already have ideas for modifying and improving this game, but I'm gonna key some more in before I stop and mess with too much code.

Link to comment
Share on other sites

Did you ever get that traffic control game to work? I never did.

Also, did you spend numerous hours typing in that huge IT text adventure game?

 

I typed in traffic control... I think it worked, but it wasn't nearly as exciting as I thought it would be. I got it on a disk somewhere.

 

I didn't type in the adventure game. At that point, I was too familiar with how limited text adventures were, especially in BASIC/Extended Basic.

 

Adamantyr

Link to comment
Share on other sites

I have that book (purchased many years after TI left the market) but I never got around to typing anything in. This seems interesting, but I wonder if there's something amiss. I recall a couple moments where the character would disappear (but I could still move).

 

Off topic: referring to that page of TI books, it was funny to see the "Itty Bitty Bytes Of Space" and I recall that I once had that. Also, those "K-power" books ("Computer Monsters", "Computer Olympics") reminded me I had the 'monsters' one...plus one that wasn't there. It was called, I think, "Computer Craziness" and had a drawing on the front resembling a circus clown or something.

 

Anybody ever have any of the "K-power" books? They were really basic, but something about them appealed to me as a kid.

Link to comment
Share on other sites

The Renko/Edwards book was translated a few times too: It is available in German as Superspiele für Ihren TI-99/4A , or in French as Les Grands Classiques du Jeu pour votre TI-99/4A .

 

I've seen it in Spanish as well.

 

I have an extensive multilingual library of TI books, including all of the K-Power books GratedTopping asked about. There were actually quite a few interesting original books in German and French.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...