Jump to content
Sinphaltimus

New 32k XB Game:ZOMBi (work in progress)

Recommended Posts

I have to tell ya. In rewriting my collision detection routines I find I'm writing what feels like 10 times more code than the original code, to perform 10 times less functions than the original code.

I sure hope the performance improvements are noticeable, I'll be ready to test within the half hour or so..

  • Like 1

Share this post


Link to post
Share on other sites

Hmmm.... I have not delved too deeply into the code, but if all your static characters are SPRITEs (except for holes), why not do a COINC(ALL) and branch to a subroutine that determines what was hit?

 

I don't know, seems the easiest way.

  • Like 1

Share this post


Link to post
Share on other sites

Hmmm.... I have not delved too deeply into the code, but if all your static characters are SPRITEs (except for holes), why not do a COINC(ALL) and branch to a subroutine that determines what was hit?

 

I don't know, seems the easiest way.

loot (zombies, hearts, melee and ranged) are not static. Player holes and exits are. That's what I was doing before with 26 sprites to go through using all.

After reworking it I am doing a level and position check first to determine player position, once I know the position of the player, I know what sprite the player is closest to being coinc with so I just run the coinc against that sprite number and the player.

 

The new method drills straight down to the answer to perform the action based on vicinity which is maybe 3-4 checks to result a coinc where as my old method relied on for next loops against the array and checking each time - this results in 23 checks (one for exit, 8 holes, 14 loot items) before it could resolve a coinc check.

 

I'm not seeing a huge performance boost yet which is why I'm still combing through code.

 

 

Edited by Sinphaltimus
  • Like 1

Share this post


Link to post
Share on other sites

If I could only get through a day without distractions. But my GoTek Amiga Floppy Drive Emulator arrived. :) Had to fire it up and poke about.

 

OK, now back to fixing this thing I broke in my code.

  • Like 1

Share this post


Link to post
Share on other sites

I'm taking a short break. More hardware projects hit me out of the blue and my brain needs a break from XB for a few days. No worries, I have every intention to make this a fully functioning game sooner than anyone thinks. :)

Edited by Sinphaltimus

Share this post


Link to post
Share on other sites

New Version 0.30

GAME IS CURRENTLY EARLY ACCESS ALPHA version. No ETA on Beta.

Just copy/paste from below OR download the class99 save dsk1.ZOMBI029 file and Extended BASIC text file that is attached here:

zip.gif Zombtiv30.zip 16.08KB 0 downloads

How To Play:

About: This is meant to be a semi casual zombie survival game to escape a skyscraper. Play for score (session high score coming soon)

Combat: A melee attack is a swing attack that covers the space directly in front and behind the player. You get one attack per inventory item.

Joystick down = ranged attack temporarily using a noise for place holder.
ZEDS: Will grab you and attack you. Hold a direction to escape, try hitting with melee, break away as fast as you can.
DODGE: You can attempt to dodge zeds by jumping past them (joystick button or J)

LOOTING: Will slow you down, jump past it to dodge the loot if you need to (for future versions when Zombies run)

Controls:

X=Quit, R=Reset, J and Controller Button = Jump, Joystick Left/Right moves left/right,

Joystick up = melee attack -
Notes: Melee attacks will destroy loot including hearts. Be careful not to use up all your melee weapons. You can miss a melee attack,
if a zombie doesn't die after 2 hits, try re positioning.

V030 changes:
Can jump while running.
improved running speed.
Re-Wrote Loot distribution and collision code and then fixed everything that I broke as a result.
Fixed GUI display issue when ranged is full causing wrap around of value on the display.
looting and zombie attacks slow you down.
Added sounds for falling and loot pickup.

 

 

 


100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0
110 MELEE=0 :: RANGED=0 !weapons inventory
120 CALL SCREEN(2)
130 CALL COLOR(10,15,1):: CALL COLOR(12,12,1):: CALL COLOR(3,12,1):: CALL COLOR(4,12,1)
140 CALL COLOR(8,7,1):: CALL COLOR(11,8,1):: CALL COLOR(14,12,1):: HCLR=1
150 CALL CLEAR
160 !running patterns right
170 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
180 !stop and jump right
190 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
200 !jumping right
210 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
220 !landing right
230 DATA 0018183050180818,1818101038501018
240 !running patterns left
250 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
260 !stop and jump left
270 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
280 !jumping left
290 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
300 !landing right
310 DATA 0018180C0A181018,181808081C0A0818
320 FOR CHRR=33 TO 38 !setup for creating running characters right
330 READ PAT$
340 CALL CHAR(CHRR,PAT$)
350 NEXT CHRR
360 REM CHR=CHRR
370 FOR CHSR=39 TO 43 !setup for creating stop and jump characters right
380 READ PAT$
390 CALL CHAR(CHSR,PAT$)
400 NEXT CHSR
410 FOR CHJR=64 TO 67 !setup for creating jumping characters right
420 READ PAT$
430 CALL CHAR(CHJR,PAT$)
440 NEXT CHJR
450 FOR CHLR=68 TO 69 !setup for creating landing characters right
460 READ PAT$
470 CALL CHAR(CHLR,PAT$)
480 NEXT CHLR
490 REM left running***********************
500 FOR CHRL=70 TO 75 !setup for creating running characters left
510 READ PAT$
520 CALL CHAR(CHRL,PAT$)
530 NEXT CHRL
540 FOR CHSL=76 TO 80 !setup for creating stop and jump characters left
550 READ PAT$
560 CALL CHAR(CHSL,PAT$)
570 NEXT CHSL
580 FOR CHJL=81 TO 84 !setup for creating jumping characters left
590 READ PAT$
600 CALL CHAR(CHJL,PAT$)
610 NEXT CHJL
620 FOR CHLL=85 TO 86 !setup for creating landing characters left
630 READ PAT$
640 CALL CHAR(CHLL,PAT$)
650 NEXT CHLL
660 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
670 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
680 CALL CHAR(104,BGIR$,105,GIR$)!girder for level creation
690 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(106,GRAV$)!THE HOLE
700 EXT$="1F1111111D11111F" :: CALL CHAR(107,EXT$)!THE EXIT
710 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(88,HRT$)!THE HEART
720 ZED$="3C2418FF9918183C" :: CALL CHAR(96,ZED$)!THE ZED
730 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(112,MLE$)!MELEE
740 RNG$="000000FF7F1E1606" :: CALL CHAR(113,RNG$)!RANGED WEAPONS
750 SCTXT1$="70808063141414E3" :: SCTXT2$="00000000334A4A32" :: SCTXT3$="00000000993C2118" !Word Score
760 CALL CHAR(120,SCTXT1$):: CALL CHAR(121,SCTXT2$):: CALL CHAR(122,SCTXT3$)
770 EXTXT$="0044442810284444" :: CALL CHAR(123,EXTXT$)! the letter X remain for GUI
780 LVLTXT$="E0E080E9EF86EFE9" :: CALL CHAR(124,LVLTXT$)! EX TEXT IN GUI
790 IDLE$="3838107CBA38286C" :: CALL CHAR(44,IDLE$)!***IDLE MAN
800 MMELE$="3C3C18FF7E3C183C" :: MRNGL$="0C0C04FC4C3C286C" :: MRNGR$="3030203F323C1436" ! MELEE & l/r RANGED ATTACKS
810 MWA$="002418FF1824" :: BULET$="0000008" !WEAPONS FIRE
820 ZDI$="3C2418FF9918183C" :: ZDA$="3CA5DB7E1818183C" :: ZWL1$="3C2C18F81838246C" :: ZWL2$="3C2C18F818181838" !ZED IDLE&WALK LEFT
830 ZWR1$="3C34181F181C2436" :: ZWR2$="3C34181F1818181C" !ZED WALK RIGHT
840 CALL CHAR(45,MMELE$,46,MRNGL$,47,MRNGR$)!MAN ATTTACKS
850 CALL CHAR(143,MWA$,142,BULET$)!WEAPONS FIRE
860 RANDOMIZE
870 SLOT=10 !STARTING SPRITE NUMBER FOR LOOT and more
880 OPTION BASE 1
890 DIM LO0T(3,14)!LOOT DISTRIBUTION AND COLLISION.
900 LTN=1 !LOOT ARRAY COORDS COL
910 LAB=1 !LOOT ARRAY COORDS ROW
920 SHL=2 :: GRND=17 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
930 LVL=3 :: YP=9 :: XP=8 :: RS=0 :: CS=16 :: RSPD=2.0 :: RSPDD=3.3 !start pos,vel,controller run speed multiplier rspd
940 ZHELTH=2 !default health of zombies start of game
950 GOSUB 2310 !*******************************Create Level
960 REM***************************************Create Sprite Idle********
970 CALL SPRITE(#1,44,6,YP,XP)
980 CALL JOYST(1,JX,JY):: !check for joystick input
990 CALL KEY(1,K,S):: IF K=0 AND S=-1 THEN 6270 :: IF K=6 THEN 1000 ELSE 1010
1000 CALL DELSPRITE(ALL):: RESTORE 170 :: GOTO 100
1010 IF JY=0 THEN 1030 ELSE 1020 ! check for combat
1020 GOSUB 6170 ! goto combat
1030 IF JX=0 THEN 1070
1040 GOSUB 5670 !**********wall collision checks
1050 CALL COINC(ALL,C):: IF C=0 THEN 1070
1060 GOSUB 2530 !****************************collision checks
1070 CALL KEY(1,K,S):: IF K<>18 AND K<>74 AND K<>106 THEN 1740 !no kb pressed check for joyst
1080 REM ********jump routine check********
1090 CALL MOTION(#1,0,0)
1100 IF CS<>-16 THEN 1140
1110 CALL POSITION(#1,YP,XP)!get new position for next sprite
1120 GOSUB 1180 ! goto jump left
1130 GOTO 960
1140 IF CS<>16 THEN 1740
1150 CALL POSITION(#1,YP,XP)!get new position for next sprite
1160 GOSUB 1460 !goto jump right**************************
1170 GOTO 960
1180 REM *************jump left routine*********
1190 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1200 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1210 FOR PT=76 TO 80 !setup stop and jump animation left
1220 CALL PATTERN(#1,PT)!ANIMATE
1230 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1240 NEXT DELAY
1250 NEXT PT !continue animating the stop and jump until done
1260 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1270 IF XP<=24 THEN 1370
1280 CS=-20 :: YP=YP-3 :: RS=0 :: CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!jumping left
1290 FOR PT=81 TO 84
1300 CALL PATTERN(#1,PT)
1310 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1320 NEXT DELAY
1330 NEXT PT
1340 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1350 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1360 YP=YP+3 !RESET YP TO BE GROUND.
1370 CALL SPRITE(#1,CHLL,6,YP,XP)
1380 FOR PT=85 TO 86 !setup landing animation left
1390 CALL PATTERN(#1,PT)
1400 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1410 NEXT DELAY
1420 NEXT PT ! continue landing animation until last frame
1430 CALL POSITION(#1,YP,XP)!get new position for next sprite
1440 CS=-16
1450 RETURN
1460 REM *************jump right routine******
1470 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1480 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1490 FOR PT=39 TO 43 !setup stop and jump animation right
1500 CALL PATTERN(#1,PT)
1510 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1520 NEXT DELAY
1530 NEXT PT !continue animating the stop and jump until done right
1540 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1550 IF XP>=224 THEN 1650
1560 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!jumping right
1570 FOR PT=64 TO 67 !setup jumping characters right
1580 CALL PATTERN(#1,PT)
1590 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1600 NEXT DELAY
1610 NEXT PT
1620 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1630 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1640 YP=YP+3
1650 CALL SPRITE(#1,CHLR,6,YP,XP)
1660 FOR PT=68 TO 69 !setup landing animation
1670 CALL PATTERN(#1,PT)
1680 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1690 NEXT DELAY
1700 NEXT PT ! continue landing animation until last frame
1710 CALL POSITION(#1,YP,XP)!get new position for next sprite
1720 CS=16
1730 RETURN
1740 REM **************Check Joyst Options************
1750 IF JX<>0 THEN 1780
1760 CALL MOTION(#1,0,0)
1770 GOTO 970
1780 REM ********running check***************
1790 IF JX<>-4 THEN 1820
1800 GOSUB 2090
1820 IF JX<>4 THEN 970
1830 GOSUB 1860
1850 GOTO 970 !after RETURN goto joyst check
1860 REM ************run right routine********
1870 CALL POSITION(#1,YP,XP)::CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP,0,JX*RSPD)!create the runner and send running
1880 FOR PT=33 TO 38 STEP 2 !setup for animating the run right
1900 CALL PATTERN(#1,PT)
1910 CALL KEY(1,K,S):: IF K=18 OR K=74 OR K=106 THEN 1080 !jump
1920 CALL JOYST(1,JX,JY):: !check for joystick input
1950 GOSUB 5670 !**********wall collision checks
1960 CALL COINC(ALL,C):: IF C=0 THEN 1970 :: CALL MOTION(#1,0,(JX*RSPD)/RSPDD):: GOSUB 2530 !collision actions
1970 IF JY=0 THEN 1990 ELSE 1980
1980 GOSUB 6170
1990 IF JX<>0 THEN 2010 ELSE 2000 !not joy pressed keep running
2000 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2010 CALL JOYST(1,JX,JY)
2020 IF JX=4 THEN 2040
2030 IF JX=-4 THEN 2080
2040 CALL MOTION(#1,0,JX*RSPD)
2050 NEXT PT
2060 IF JX=4 THEN 1880
2070 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
2080 RETURN
2090 REM **********run left routine**************
2100 CALL POSITION(#1,YP,XP)::CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP,0,JX*RSPD)!create the runner and send running
2110 FOR PT=70 TO 75 STEP 2 !setup for animating the run left
2130 CALL PATTERN(#1,PT)
2140 CALL KEY(1,K,S):: IF K=18 OR K=74 OR K=106 THEN 1080 !jump
2150 CALL JOYST(1,JX,JY)!check for joystick input
2180 GOSUB 5670 !**********wall collision checks
2185 CALL COINC(ALL,C):: IF C=0 THEN 2190 :: CALL MOTION(#1,0,(JX*RSPD)/RSPDD):: GOSUB 2530 !collision actions
2190 IF JY=0 THEN 2210 ELSE 2200
2200 GOSUB 6170
2210 IF JX<>0 THEN 2230 !not joy pressed keep running
2220 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2230 CALL JOYST(1,JX,JY)
2240 IF JX=-4 THEN 2260
2250 IF JX=4 THEN 2300
2260 CALL MOTION(#1,0,JX*RSPD)
2270 NEXT PT
2280 IF JX=-4 THEN 2110
2290 CALL POSITION(#1,YP,XP)!check position and store for next sprite
2300 RETURN
2310 REM *************************************************************************level creation************************
2320 GOSUB 5750 !*************************gui creation******
2330 HLE=INT((RND*15)+5)
2340 FOR LVL=1 TO 8
2350 IF LVL=1 THEN 2370
2360 GOSUB 5230 !*************************************GOSUB********LOOT DS**********
2370 CALL VCHAR(1,1,105,24)!LEFT WALL
2380 CALL VCHAR(1,32,105,24)!RIGHT WALL
2390 CALL HCHAR(LVL*3,1,105,HLE-1)!LEFT SIDE GIRDERS
2400 IF LVL=8 THEN 2420 :: CALL SPRITE(#SHL,106,HCLR,GRND-8,(HLE* 8)+1)!HOLE PROPER
2410 SHL=SHL+1 !ADVANCE SPRITE #
2420 LASTHLE=(HLE* 8)+1 :: CALL HCHAR(LVL*3,HLE+3,105,32-(HLE+3))!RIGHT SIDE Girders
2430 IF LVL=8 THEN 2490 :: CALL HCHAR(LVL*3,HLE,104)!CRUMBLE LEFT SIDE
2440 CALL HCHAR(LVL*3,HLE+2,104)!crumble right side
2450 GRND=GRND+24
2460 HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2470 IF HOL=HLE THEN 2460 !NOT EQUAL TO PREVIOUS HOLE
2480 HLE=HOL !SET PROPER HOLE VARIABLE
2490 NEXT LVL !GO CREATE NEXT LEVEL
2500 CALL SPRITE(#9,107,15,22*8,30* 8)! THE EXIT
2510 CALL HCHAR(24,1,105,31)!THE FLOOR
2520 RETURN
2530 REM *********************************collision detection routines*******
2540 GOSUB 5670 !**********wall collision checks
2550 CALL POSITION(#1,YP,XP)
2560 IF YP<>9 THEN 2590 ! top level 1
2570 CALL COINC(#1,#2,8,C)
2580 IF C=0 THEN RETURN ELSE 5190 !check for hole level 1
2590 IF YP<>33 THEN 2940 !level 2
2600 CALL POSITION(#3,HY,HX):: LOOT=LO0T(1,1)
2610 CALL POSITION(#1,YP,XP)
2620 IF XP<=HX THEN 2630 ELSE 2770
2630 CALL COINC(#1,#10,8,C)
2640 IF C<>0 THEN 2680
2650 CALL COINC(#1,#3,8,C)
2660 IF C<>0 THEN 5190 !check for hole level 2
2670 RETURN
2680 DET=10
2690 IF LOOT<>88 THEN 2710
2700 GOTO 5140 !do heart
2710 IF LOOT<>96 THEN 2730
2720 GOTO 5100 !do zed
2730 IF LOOT<>112 THEN 2750
2740 GOTO 5060 !do melee
2750 IF LOOT<>113 THEN RETURN
2760 GOTO 5020 ! do ranged
2770 LOOT=LO0T(1,2)
2780 CALL POSITION(#1,YP,XP)
2790 IF XP>HX THEN 2800 ELSE RETURN
2800 CALL COINC(#1,#11,8,C)
2810 IF C<>0 THEN 2850
2820 CALL COINC(#1,#3,8,C)
2830 IF C<>0 THEN 5190 !check for hole level 2
2840 RETURN
2850 DET=11
2860 IF LOOT<>88 THEN 2880
2870 GOTO 5140 !do heart
2880 IF LOOT<>96 THEN 2900
2890 GOTO 5100 !do zed
2900 IF LOOT<>112 THEN 2920
2910 GOTO 5060 !do melee
2920 IF LOOT<>113 THEN RETURN
2930 GOTO 5020 ! do ranged
2940 IF YP<>57 THEN 3290 !level 3
2950 CALL POSITION(#4,HY,HX):: LOOT=LO0T(1,3)
2960 CALL POSITION(#1,YP,XP)
2970 IF XP<=HX THEN 2980 ELSE 3120
2980 CALL COINC(#1,#12,8,C)
2990 IF C<>0 THEN 3030
3000 CALL COINC(#1,#4,8,C)
3010 IF C<>0 THEN 5190 !check for hole level 3
3020 RETURN
3030 DET=12
3040 IF LOOT<>88 THEN 3060
3050 GOTO 5140 !do heart
3060 IF LOOT<>96 THEN 3080
3070 GOTO 5100 !do zed
3080 IF LOOT<>112 THEN 3100
3090 GOTO 5060 !do melee
3100 IF LOOT<>113 THEN RETURN
3110 GOTO 5020 ! do ranged
3120 LOOT=LO0T(1,4)
3130 CALL POSITION(#1,YP,XP)
3140 IF XP>HX THEN 3150 ELSE RETURN
3150 CALL COINC(#1,#13,8,C)
3160 IF C<>0 THEN 3200
3170 CALL COINC(#1,#4,8,C)
3180 IF C<>0 THEN 5190 !check for hole level 3
3190 RETURN
3200 DET=13
3210 IF LOOT<>88 THEN 3230
3220 GOTO 5140 !do heart
3230 IF LOOT<>96 THEN 3250
3240 GOTO 5100 !do zed
3250 IF LOOT<>112 THEN 3270
3260 GOTO 5060 !do melee
3270 IF LOOT<>113 THEN RETURN
3280 GOTO 5020 ! do ranged
3290 IF YP<>81 THEN 3640 !level 4
3300 CALL POSITION(#5,HY,HX):: :: LOOT=LO0T(1,5)
3310 CALL POSITION(#1,YP,XP)
3320 IF XP<=HX THEN 3330 ELSE 3470
3330 CALL COINC(#1,#14,8,C)
3340 IF C<>0 THEN 3380
3350 CALL COINC(#1,#5,8,C)
3360 IF C<>0 THEN 5190 !check for hole level 4
3370 RETURN
3380 DET=14
3390 IF LOOT<>88 THEN 3410
3400 GOTO 5140 !do heart
3410 IF LOOT<>96 THEN 3430
3420 GOTO 5100 !do zed
3430 IF LOOT<>112 THEN 3450
3440 GOTO 5060 !do melee
3450 IF LOOT<>113 THEN RETURN
3460 GOTO 5020 ! do ranged
3470 LOOT=LO0T(1,6)
3480 CALL POSITION(#1,YP,XP)
3490 IF XP>HX THEN 3500 ELSE RETURN
3500 CALL COINC(#1,#15,8,C)
3510 IF C<>0 THEN 3550
3520 CALL COINC(#1,#5,8,C)
3530 IF C<>0 THEN 5190 !check for hole level 4
3540 RETURN
3550 DET=15
3560 IF LOOT<>88 THEN 3580
3570 GOTO 5140 !do heart
3580 IF LOOT<>96 THEN 3600
3590 GOTO 5100 !do zed
3600 IF LOOT<>112 THEN 3620
3610 GOTO 5060 !do melee
3620 IF LOOT<>113 THEN RETURN
3630 GOTO 5020 ! do ranged
3640 IF YP<>105 THEN 3990 !level 5
3650 CALL POSITION(#6,HY,HX):: LOOT=LO0T(1,7)
3660 CALL POSITION(#1,YP,XP)::
3670 IF XP<=HX THEN 3680 ELSE 3820
3680 CALL COINC(#1,#16,8,C)
3690 IF C<>0 THEN 3730
3700 CALL COINC(#1,#6,8,C)
3710 IF C<>0 THEN 5190 !check for hole level 5
3720 RETURN
3730 DET=16
3740 IF LOOT<>88 THEN 3580
3750 GOTO 5140 !do heart
3760 IF LOOT<>96 THEN 3780
3770 GOTO 5100 !do zed
3780 IF LOOT<>112 THEN 3800
3790 GOTO 5060 !do melee
3800 IF LOOT<>113 THEN RETURN
3810 GOTO 5020 ! do ranged
3820 LOOT=LO0T(1, 8)
3830 CALL POSITION(#1,YP,XP)
3840 IF XP>HX THEN 3850 ELSE RETURN
3850 CALL COINC(#1,#17,8,C)
3860 IF C<>0 THEN 3900
3870 CALL COINC(#1,#6,8,C)
3880 IF C<>0 THEN 5190 !check for hole level 5
3890 RETURN
3900 DET=17
3910 IF LOOT<>88 THEN 3930
3920 GOTO 5140 !do heart
3930 IF LOOT<>96 THEN 3950
3940 GOTO 5100 !do zed
3950 IF LOOT<>112 THEN 3970
3960 GOTO 5060 !do melee
3970 IF LOOT<>113 THEN RETURN
3980 GOTO 5020 ! do ranged
3990 IF YP<>129 THEN 4340 !level 6
4000 CALL POSITION(#7,HY,HX):: LOOT=LO0T(1,9)
4010 CALL POSITION(#1,YP,XP)
4020 IF XP<=HX THEN 4030 ELSE 4170
4030 CALL COINC(#1,#18,8,C)
4040 IF C<>0 THEN 4080
4050 CALL COINC(#1,#7,8,C)
4060 IF C<>0 THEN 5190 !check for hole level 6
4070 RETURN
4080 DET=18
4090 IF LOOT<>88 THEN 4110
4100 GOTO 5140 !do heart
4110 IF LOOT<>96 THEN 4130
4120 GOTO 5100 !do zed
4130 IF LOOT<>112 THEN 4150
4140 GOTO 5060 !do melee
4150 IF LOOT<>113 THEN RETURN
4160 GOTO 5020 ! do ranged
4170 LOOT=LO0T(1,10)
4180 CALL POSITION(#1,YP,XP)
4190 IF XP>HX THEN 4200 ELSE RETURN
4200 CALL COINC(#1,#19,8,C)
4210 IF C<>0 THEN 4250
4220 CALL COINC(#1,#7,8,C)
4230 IF C<>0 THEN 5190 !check for hole level 6
4240 RETURN
4250 DET=19
4260 IF LOOT<>88 THEN 4280
4270 GOTO 5140 !do heart
4280 IF LOOT<>96 THEN 4300
4290 GOTO 5100 !do zed
4300 IF LOOT<>112 THEN 4320
4310 GOTO 5060 !do melee
4320 IF LOOT<>113 THEN RETURN
4330 GOTO 5020 ! do ranged
4340 IF YP<>153 THEN 4690 !level 7
4350 CALL POSITION(#8,HY,HX):: LOOT=LO0T(1,11)
4360 CALL POSITION(#1,YP,XP)
4370 IF XP<=HX THEN 4380 ELSE 4520
4380 CALL COINC(#1,#20,8,C)
4390 IF C<>0 THEN 4430
4400 CALL COINC(#1,#8,8,C)
4410 IF C<>0 THEN 5190 !check for hole level 7
4420 RETURN
4430 DET=20
4440 IF LOOT<>88 THEN 4460
4450 GOTO 5140 !do heart
4460 IF LOOT<>96 THEN 4480
4470 GOTO 5100 !do zed
4480 IF LOOT<>112 THEN 4500
4490 GOTO 5060 !do melee
4500 IF LOOT<>113 THEN RETURN
4510 GOTO 5020 ! do ranged
4520 LOOT=LO0T(1,12)
4530 CALL POSITION(#1,YP,XP)
4540 IF XP>HX THEN 4550 ELSE RETURN
4550 CALL COINC(#1,#21,8,C)
4560 IF C<>0 THEN 4600
4570 CALL COINC(#1,#8,8,C)
4580 IF C<>0 THEN 5190 !check for hole level 7
4590 RETURN
4600 DET=21
4610 IF LOOT<>88 THEN 4630
4620 GOTO 5140 !do heart
4630 IF LOOT<>96 THEN 4650
4640 GOTO 5100 !do zed
4650 IF LOOT<>112 THEN 4670
4660 GOTO 5060 !do melee
4670 IF LOOT<>113 THEN RETURN
4680 GOTO 5020 ! do ranged
4690 IF YP<>177 THEN RETURN !level 8 ground floor
4700 HX=LASTHLE :: LOOT=LO0T(1,13)
4710 CALL POSITION(#1,YP,XP)
4720 IF XP<=HX THEN 4730 ELSE 4860
4730 CALL COINC(#1,#22,8,C)
4740 IF C<>0 THEN 4770
4750 CALL COINC(#1,#9,4,C)
4760 IF C<>0 THEN 5210 ELSE RETURN !****collision check against exit
4770 DET=22
4780 IF LOOT<>88 THEN 4800
4790 GOTO 5140 !do heart
4800 IF LOOT<>96 THEN 4820
4810 GOTO 5100 !do zed
4820 IF LOOT<>112 THEN 4840
4830 GOTO 5060 !do melee
4840 IF LOOT<>113 THEN RETURN
4850 GOTO 5020 ! do ranged
4860 LOOT=LO0T(1,14)
4870 CALL POSITION(#1,YP,XP)
4880 IF XP>HX THEN 4890 ELSE RETURN
4890 CALL COINC(#1,#23,8,C)
4900 IF C<>0 THEN 4930
4910 CALL COINC(#1,#9,4,C)
4920 IF C<>0 THEN 5210 ELSE RETURN !****collision check against exit
4930 DET=23
4940 IF LOOT<>88 THEN 4960
4950 GOTO 5140 !do heart
4960 IF LOOT<>96 THEN 4980
4970 GOTO 5100 !do zed
4980 IF LOOT<>112 THEN 5000
4990 GOTO 5060 !do melee
5000 IF LOOT<>113 THEN RETURN
5010 GOTO 5020 ! do ranged
5020 REM **********ranged
5030 SCORE=SCORE+5 :: IF RANGED<10 THEN RANGED=RANGED+1:: CALL SOUND(1,1000,5)::CALL SOUND(1,1200,2)
5040 GOSUB 5750 !*************************gui UPDATE******
5050 GOTO 5170
5060 REM *********melee
5070 SCORE=SCORE+3 :: IF MELEE<10 THEN MELEE=MELEE+1:: CALL SOUND(1,1500,5)::CALL SOUND(1,1600,2)::
5080 GOSUB 5750 !*************************gui UPDATE******
5090 GOTO 5170
5100 REM *************zed
5110 CALL SOUND(100,-4,0,110,0,1000,0):: HEALTH=HEALTH-1 :: IF HEALTH<=0 THEN 5810
5120 GOSUB 5750 !*************************gui UPDATE******
5130 RETURN
5140 REM *************HEART
5150 SCORE=SCORE+8 :: CALL SOUND(1,500,5)::CALL SOUND(1,600,2)::IF HEALTH<10 THEN HEALTH=HEALTH+1
5160 GOSUB 5750 !*************************gui UPDATE******
5170 IF DET=O THEN 5180 :: CALL DELSPRITE(#DET):: RETURN
5180 RETURN
5190 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SOUND(1,666-(FALL*10),5):: CALL SPRITE(#1,44,6,YP,XP):: NEXT FALL !*****FALL**********
5200 RETURN
5210 REM *****************************************************BOARD**Progression************
5220 CALL DELSPRITE(ALL):: BOARD=BOARD+1 :: RESTORE 170 :: IF SCORE>HSCORE THEN HSCORE=SCORE :: GOTO 120
5230 REM ***********************************************************LOOT DISTRIBUTION SYSTEM******
5240 REM*******SWITCH=-5 !SWITCH=INT(RND*2)+1
5250 REM******FOR LT=1 TO 2
5260 LOOTL=INT(RND*4)+1
5270 LOOTR=INT(RND*4)+1
5280 REM******IF SWITCH=1 THEN 8860 ELSE 8880
5290 REM******SWITCH=-5::GOTO 8940
5300 REM******IF SWITCH=2 THEN 8900 ELSE 8920
5310 REM*********SWITCH=5::GOTO 8880
5320 REM******IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
5330 IF LOOTL<>1 THEN 5370
5340 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !HEART 88
5350 LO0T(LAB,LTN)=88 :: LAB=LAB+1
5360 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5370 IF LOOTL<>2 THEN 5410
5380 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !ZED 96
5390 LO0T(LAB,LTN)=96 :: LAB=LAB+1
5400 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5410 IF LOOTL<>3 THEN 5450
5420 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !MELEE 112
5430 LO0T(LAB,LTN)=112 :: LAB=LAB+1
5440 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5450 IF LOOTL<>4 THEN 5490
5460 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !RANGED 113
5470 LO0T(LAB,LTN)=113 :: LAB=LAB+1
5480 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5490 IF LOOTR<>1 THEN 5530
5500 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !HEART 88
5510 LO0T(LAB,LTN)=88 :: LAB=LAB+1
5520 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5530 IF LOOTR<>2 THEN 5570
5540 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !ZED 96
5550 LO0T(LAB,LTN)=96 :: LAB=LAB+1
5560 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5570 IF LOOTR<>3 THEN 5610
5580 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !MELEE 112
5590 LO0T(LAB,LTN)=112 :: LAB=LAB+1
5600 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5610 IF LOOTR<>4 THEN 5650
5620 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !RANGED 113
5630 LO0T(LAB,LTN)=113 :: LAB=LAB+1
5640 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5650 REM ***NEXT LT
5660 RETURN
5670 REM **********cOLLISION cHECK WALLs
5680 CALL POSITION(#1,YP,XP)
5690 IF XP<=12 THEN 5700 ELSE 5720
5700 CALL LOCATE(#1,YP,13):: CALL MOTION(#1,0,0)
5710 CALL JOYST(1,JX,JY):: IF JX=-4 THEN 5700 ELSE RETURN
5720 IF XP>=240 THEN 5730 ELSE RETURN
5730 CALL LOCATE(#1,YP,239):: CALL MOTION(#1,0,0)
5740 CALL JOYST(1,JX,JY):: IF JX=4 THEN 5730 ELSE RETURN
5750 REM ********************GUI Update***********
5760 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,10):BOARD :: DISPLAY AT(1,15):HEALTH :: DISPLAY AT(1,21):MELEE :: DISPLAY AT(1,26):RANGED !Output GUI
5770 CALL VCHAR(1,3,120):: CALL VCHAR(1,4,121):: CALL VCHAR(1,5,122)!score text gui
5780 CALL VCHAR(1,12,123):: CALL VCHAR(1,17,123):: CALL VCHAR(1,23,123):: CALL VCHAR(1,28,123)!Xs gui
5790 CALL VCHAR(1,11,124):: CALL VCHAR(1,16,88):: CALL VCHAR(1,22,112):: CALL VCHAR(1,27,113)!BOARD,hearts,melee,ranged gui
5800 RETURN
5810 REM ******************************YOU ARE DEAD***********************
5820 CALL MOTION(#1,0,0):: CALL DELSPRITE(ALL):: CALL SCREEN(10)
5830 DATA 89,0044442810101010,79,007C44444444447C,85,0044444444444438
5840 DATA 65,003844447C444444,82,0078444478504844,69,007C40407840407C
5850 DATA 68,0078242424242478
5860 FOR YAD=1 TO 7
5870 READ YADC,YADP$
5880 CALL CHAR(YADC,YADP$)
5890 NEXT YAD
5900 CALL CLEAR
5910 CALL VCHAR(12,10,89):: CALL VCHAR(12,11,79):: CALL VCHAR(12,12,85):: CALL VCHAR(12,13,32)!YOU
5920 CALL VCHAR(12,14,65):: CALL VCHAR(12,15,82):: CALL VCHAR(12,16,69):: CALL VCHAR(12,17,32)!ARE
5930 CALL VCHAR(12,18,68):: CALL VCHAR(12,19,69):: CALL VCHAR(12,20,65):: CALL VCHAR(12,21,68)!DEAD
5940 FOR CLRS=1 TO 13 :: CALL COLOR(CLRS,16,1):: NEXT CLRS
5950 CALL SCREEN(2)
5960 GOSUB 5750
5970 CALL KEY(1,K,S):: IF K=0 AND S=-1 THEN 6270 :: IF K=6 THEN 5980 ELSE 5990
5980 CALL DELSPRITE(ALL):: RESTORE 170 :: GOTO 100
5990 CALL JOYST(1,JX,JY):: IF JX=0 THEN 5970 :: IF JY=0 THEN 5970 ELSE 5980
6000 REM*******************MAN MELEE ATTACK
6010 CALL PATTERN(#1,45)!melee attack pattern
6020 CALL SPRITE(#24,143,12,YP,XP+ 8):: CALL SOUND(125,-5,0)!right attack
6030 GOSUB 6300 !MELLE HIT DETECTION RIGHT
6040 CALL DELSPRITE(#24)
6050 CALL SPRITE(#25,143,12,YP,XP- 8):: CALL SOUND(125,-6,0)!left attack
6060 GOSUB 6360 !MELEE HIT DETECTION LEFT
6070 CALL DELSPRITE(#25)
6080 CALL PATTERN(#1,44):: RETURN
6090 REM ******************MAN RANGED ATTACK
6100 CALL SOUND(100,-6,0):: RETURN
6110 !IF KSLOT=1 THEN 7090::RETURN
6120 !KSLOT=0::SLOT=SLOT-1::RETURN
6130 REM*****************ZED COINC BEHAVIOR*************
6140 RETURN
6150 REM****************ZED ATTACK******************
6160 RETURN
6170 REM *****JOYS Combat choice*****
6180 IF JY=4 AND MELEE>=1 THEN 6200 ELSE 6190
6190 CALL SOUND(100,-3,0):: RETURN
6200 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP)
6210 MELEE=MELEE-1 :: GOSUB 5750 !*******UPDATE GUI
6220 GOSUB 6000 !PERFORM MELEE ATTACK
6230 RETURN
6240 IF JY=-4 THEN 6250 ELSE 6260
6250 GOSUB 6100
6260 RETURN
6270 REM***quit game
6280 CALL CLEAR
6290 END
6300 !************************mELEE collision check against LOOT*********************
6310 REM FOR DETT=10 TO 23 !MELEE RIGHT
6320 CALL COINC(#24,#DET,7,C)
6330 IF C<>0 THEN 6410 ELSE 6340
6340 REM NEXT DETT
6350 RETURN
6360 REM FOR DETT=10 TO 23 !MELEE LEFT
6370 CALL COINC(#25,#DET,7,C)
6380 IF C<>0 THEN 6410 ELSE 6390
6390 REM NEXT DETT::
6400 RETURN
6410 TLOOP1=DET-9
6420 IF LO0T(1,TLOOP1)<>88 THEN 6430 ELSE 6510 !heart
6430 IF LO0T(1,TLOOP1)<>96 THEN 6480 !zed - ALL ALPHA TEMP CODE
6440 ZHELTH=ZHELTH-1 :: IF ZHELTH>=1 THEN 6520
6450 SCORE=SCORE+10 :: ZHELTH=2
6460 GOSUB 5750 !*****gui UPDATE******
6470 GOTO 6510
6480 IF LO0T(1,TLOOP1)<>112 THEN 6500 !melee
6490 GOTO 6510
6500 IF LO0T(1,TLOOP1)<>113 THEN 6520 !ranged
6510 CALL DELSPRITE(#DET):: RETURN
6520 RETURN
6530 GOTO 5060 !do melee

 

 


100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0
110 MELEE=0 :: RANGED=0 !weapons inventory
120 CALL SCREEN(2)
130 CALL COLOR(10,15,1):: CALL COLOR(12,12,1):: CALL COLOR(3,12,1):: CALL COLOR(4,12,1)
140 CALL COLOR(8,7,1):: CALL COLOR(11,8,1):: CALL COLOR(14,12,1):: HCLR=1
150 CALL CLEAR
160 !running patterns right
170 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
180 !stop and jump right
190 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
200 !jumping right
210 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
220 !landing right
230 DATA 0018183050180818,1818101038501018
240 !running patterns left
250 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
260 !stop and jump left
270 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
280 !jumping left
290 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
300 !landing right
310 DATA 0018180C0A181018,181808081C0A0818
320 FOR CHRR=33 TO 38 !setup for creating running characters right
330 READ PAT$
340 CALL CHAR(CHRR,PAT$)
350 NEXT CHRR
360 REM CHR=CHRR
370 FOR CHSR=39 TO 43 !setup for creating stop and jump characters right
380 READ PAT$
390 CALL CHAR(CHSR,PAT$)
400 NEXT CHSR
410 FOR CHJR=64 TO 67 !setup for creating jumping characters right
420 READ PAT$
430 CALL CHAR(CHJR,PAT$)
440 NEXT CHJR
450 FOR CHLR=68 TO 69 !setup for creating landing characters right
460 READ PAT$
470 CALL CHAR(CHLR,PAT$)
480 NEXT CHLR
490 REM left running***********************
500 FOR CHRL=70 TO 75 !setup for creating running characters left
510 READ PAT$
520 CALL CHAR(CHRL,PAT$)
530 NEXT CHRL
540 FOR CHSL=76 TO 80 !setup for creating stop and jump characters left
550 READ PAT$
560 CALL CHAR(CHSL,PAT$)
570 NEXT CHSL
580 FOR CHJL=81 TO 84 !setup for creating jumping characters left
590 READ PAT$
600 CALL CHAR(CHJL,PAT$)
610 NEXT CHJL
620 FOR CHLL=85 TO 86 !setup for creating landing characters left
630 READ PAT$
640 CALL CHAR(CHLL,PAT$)
650 NEXT CHLL
660 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
670 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
680 CALL CHAR(104,BGIR$,105,GIR$)!girder for level creation
690 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(106,GRAV$)!THE HOLE
700 EXT$="1F1111111D11111F" :: CALL CHAR(107,EXT$)!THE EXIT
710 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(88,HRT$)!THE HEART
720 ZED$="3C2418FF9918183C" :: CALL CHAR(96,ZED$)!THE ZED
730 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(112,MLE$)!MELEE
740 RNG$="000000FF7F1E1606" :: CALL CHAR(113,RNG$)!RANGED WEAPONS
750 SCTXT1$="70808063141414E3" :: SCTXT2$="00000000334A4A32" :: SCTXT3$="00000000993C2118" !Word Score
760 CALL CHAR(120,SCTXT1$):: CALL CHAR(121,SCTXT2$):: CALL CHAR(122,SCTXT3$)
770 EXTXT$="0044442810284444" :: CALL CHAR(123,EXTXT$)! the letter X remain for GUI
780 LVLTXT$="E0E080E9EF86EFE9" :: CALL CHAR(124,LVLTXT$)! EX TEXT IN GUI
790 IDLE$="3838107CBA38286C" :: CALL CHAR(44,IDLE$)!***IDLE MAN
800 MMELE$="3C3C18FF7E3C183C" :: MRNGL$="0C0C04FC4C3C286C" :: MRNGR$="3030203F323C1436" ! MELEE & l/r RANGED ATTACKS
810 MWA$="002418FF1824" :: BULET$="0000008" !WEAPONS FIRE
820 ZDI$="3C2418FF9918183C" :: ZDA$="3CA5DB7E1818183C" :: ZWL1$="3C2C18F81838246C" :: ZWL2$="3C2C18F818181838" !ZED IDLE&WALK LEFT
830 ZWR1$="3C34181F181C2436" :: ZWR2$="3C34181F1818181C" !ZED WALK RIGHT
840 CALL CHAR(45,MMELE$,46,MRNGL$,47,MRNGR$)!MAN ATTTACKS
850 CALL CHAR(143,MWA$,142,BULET$)!WEAPONS FIRE
860 RANDOMIZE
870 SLOT=10 !STARTING SPRITE NUMBER FOR LOOT and more
880 OPTION BASE 1
890 DIM LO0T(3,14)!LOOT DISTRIBUTION AND COLLISION.
900 LTN=1 !LOOT ARRAY COORDS COL
910 LAB=1 !LOOT ARRAY COORDS ROW
920 SHL=2 :: GRND=17 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
930 LVL=3 :: YP=9 :: XP=8 :: RS=0 :: CS=16 :: RSPD=2.0 :: RSPDD=3.3 !start pos,vel,controller run speed multiplier rspd
940 ZHELTH=2 !default health of zombies start of game
950 GOSUB 2310 !*******************************Create Level
960 REM***************************************Create Sprite Idle********
970 CALL SPRITE(#1,44,6,YP,XP)
980 CALL JOYST(1,JX,JY):: !check for joystick input
990 CALL KEY(1,K,S):: IF K=0 AND S=-1 THEN 6270 :: IF K=6 THEN 1000 ELSE 1010
1000 CALL DELSPRITE(ALL):: RESTORE 170 :: GOTO 100
1010 IF JY=0 THEN 1030 ELSE 1020 ! check for combat
1020 GOSUB 6170 ! goto combat
1030 IF JX=0 THEN 1070
1040 GOSUB 5670 !**********wall collision checks
1050 CALL COINC(ALL,C):: IF C=0 THEN 1070
1060 GOSUB 2530 !****************************collision checks
1070 CALL KEY(1,K,S):: IF K<>18 AND K<>74 AND K<>106 THEN 1740 !no kb pressed check for joyst
1080 REM ********jump routine check********
1090 CALL MOTION(#1,0,0)
1100 IF CS<>-16 THEN 1140
1110 CALL POSITION(#1,YP,XP)!get new position for next sprite
1120 GOSUB 1180 ! goto jump left
1130 GOTO 960
1140 IF CS<>16 THEN 1740
1150 CALL POSITION(#1,YP,XP)!get new position for next sprite
1160 GOSUB 1460 !goto jump right**************************
1170 GOTO 960
1180 REM *************jump left routine*********
1190 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1200 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1210 FOR PT=76 TO 80 !setup stop and jump animation left
1220 CALL PATTERN(#1,PT)!ANIMATE
1230 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1240 NEXT DELAY
1250 NEXT PT !continue animating the stop and jump until done
1260 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1270 IF XP<=24 THEN 1370
1280 CS=-20 :: YP=YP-3 :: RS=0 :: CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!jumping left
1290 FOR PT=81 TO 84
1300 CALL PATTERN(#1,PT)
1310 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1320 NEXT DELAY
1330 NEXT PT
1340 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1350 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1360 YP=YP+3 !RESET YP TO BE GROUND.
1370 CALL SPRITE(#1,CHLL,6,YP,XP)
1380 FOR PT=85 TO 86 !setup landing animation left
1390 CALL PATTERN(#1,PT)
1400 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1410 NEXT DELAY
1420 NEXT PT ! continue landing animation until last frame
1430 CALL POSITION(#1,YP,XP)!get new position for next sprite
1440 CS=-16
1450 RETURN
1460 REM *************jump right routine******
1470 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1480 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1490 FOR PT=39 TO 43 !setup stop and jump animation right
1500 CALL PATTERN(#1,PT)
1510 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1520 NEXT DELAY
1530 NEXT PT !continue animating the stop and jump until done right
1540 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1550 IF XP>=224 THEN 1650
1560 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!jumping right
1570 FOR PT=64 TO 67 !setup jumping characters right
1580 CALL PATTERN(#1,PT)
1590 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1600 NEXT DELAY
1610 NEXT PT
1620 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1630 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1640 YP=YP+3
1650 CALL SPRITE(#1,CHLR,6,YP,XP)
1660 FOR PT=68 TO 69 !setup landing animation
1670 CALL PATTERN(#1,PT)
1680 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1690 NEXT DELAY
1700 NEXT PT ! continue landing animation until last frame
1710 CALL POSITION(#1,YP,XP)!get new position for next sprite
1720 CS=16
1730 RETURN
1740 REM **************Check Joyst Options************
1750 IF JX<>0 THEN 1780
1760 CALL MOTION(#1,0,0)
1770 GOTO 970
1780 REM ********running check***************
1790 IF JX<>-4 THEN 1820
1800 GOSUB 2090
1820 IF JX<>4 THEN 970
1830 GOSUB 1860
1850 GOTO 970 !after RETURN goto joyst check
1860 REM ************run right routine********
1870 CALL POSITION(#1,YP,XP)::CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP,0,JX*RSPD)!create the runner and send running
1880 FOR PT=33 TO 38 STEP 2 !setup for animating the run right
1900 CALL PATTERN(#1,PT)
1910 CALL KEY(1,K,S):: IF K=18 OR K=74 OR K=106 THEN 1080 !jump
1920 CALL JOYST(1,JX,JY):: !check for joystick input
1950 GOSUB 5670 !**********wall collision checks
1960 CALL COINC(ALL,C):: IF C=0 THEN 1970 :: CALL MOTION(#1,0,(JX*RSPD)/RSPDD):: GOSUB 2530 !collision actions
1970 IF JY=0 THEN 1990 ELSE 1980
1980 GOSUB 6170
1990 IF JX<>0 THEN 2010 ELSE 2000 !not joy pressed keep running
2000 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2010 CALL JOYST(1,JX,JY)
2020 IF JX=4 THEN 2040
2030 IF JX=-4 THEN 2080
2040 CALL MOTION(#1,0,JX*RSPD)
2050 NEXT PT
2060 IF JX=4 THEN 1880
2070 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
2080 RETURN
2090 REM **********run left routine**************
2100 CALL POSITION(#1,YP,XP)::CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP,0,JX*RSPD)!create the runner and send running
2110 FOR PT=70 TO 75 STEP 2 !setup for animating the run left
2130 CALL PATTERN(#1,PT)
2140 CALL KEY(1,K,S):: IF K=18 OR K=74 OR K=106 THEN 1080 !jump
2150 CALL JOYST(1,JX,JY)!check for joystick input
2180 GOSUB 5670 !**********wall collision checks
2185 CALL COINC(ALL,C):: IF C=0 THEN 2190 :: CALL MOTION(#1,0,(JX*RSPD)/RSPDD):: GOSUB 2530 !collision actions
2190 IF JY=0 THEN 2210 ELSE 2200
2200 GOSUB 6170
2210 IF JX<>0 THEN 2230 !not joy pressed keep running
2220 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2230 CALL JOYST(1,JX,JY)
2240 IF JX=-4 THEN 2260
2250 IF JX=4 THEN 2300
2260 CALL MOTION(#1,0,JX*RSPD)
2270 NEXT PT
2280 IF JX=-4 THEN 2110
2290 CALL POSITION(#1,YP,XP)!check position and store for next sprite
2300 RETURN
2310 REM *************************************************************************level creation************************
2320 GOSUB 5750 !*************************gui creation******
2330 HLE=INT((RND*15)+5)
2340 FOR LVL=1 TO 8
2350 IF LVL=1 THEN 2370
2360 GOSUB 5230 !*************************************GOSUB********LOOT DS**********
2370 CALL VCHAR(1,1,105,24)!LEFT WALL
2380 CALL VCHAR(1,32,105,24)!RIGHT WALL
2390 CALL HCHAR(LVL*3,1,105,HLE-1)!LEFT SIDE GIRDERS
2400 IF LVL=8 THEN 2420 :: CALL SPRITE(#SHL,106,HCLR,GRND-8,(HLE* 8)+1)!HOLE PROPER
2410 SHL=SHL+1 !ADVANCE SPRITE #
2420 LASTHLE=(HLE* 8)+1 :: CALL HCHAR(LVL*3,HLE+3,105,32-(HLE+3))!RIGHT SIDE Girders
2430 IF LVL=8 THEN 2490 :: CALL HCHAR(LVL*3,HLE,104)!CRUMBLE LEFT SIDE
2440 CALL HCHAR(LVL*3,HLE+2,104)!crumble right side
2450 GRND=GRND+24
2460 HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2470 IF HOL=HLE THEN 2460 !NOT EQUAL TO PREVIOUS HOLE
2480 HLE=HOL !SET PROPER HOLE VARIABLE
2490 NEXT LVL !GO CREATE NEXT LEVEL
2500 CALL SPRITE(#9,107,15,22*8,30* 8)! THE EXIT
2510 CALL HCHAR(24,1,105,31)!THE FLOOR
2520 RETURN
2530 REM *********************************collision detection routines*******
2540 GOSUB 5670 !**********wall collision checks
2550 CALL POSITION(#1,YP,XP)
2560 IF YP<>9 THEN 2590 ! top level 1
2570 CALL COINC(#1,#2,8,C)
2580 IF C=0 THEN RETURN ELSE 5190 !check for hole level 1
2590 IF YP<>33 THEN 2940 !level 2
2600 CALL POSITION(#3,HY,HX):: LOOT=LO0T(1,1)
2610 CALL POSITION(#1,YP,XP)
2620 IF XP<=HX THEN 2630 ELSE 2770
2630 CALL COINC(#1,#10,8,C)
2640 IF C<>0 THEN 2680
2650 CALL COINC(#1,#3,8,C)
2660 IF C<>0 THEN 5190 !check for hole level 2
2670 RETURN
2680 DET=10
2690 IF LOOT<>88 THEN 2710
2700 GOTO 5140 !do heart
2710 IF LOOT<>96 THEN 2730
2720 GOTO 5100 !do zed
2730 IF LOOT<>112 THEN 2750
2740 GOTO 5060 !do melee
2750 IF LOOT<>113 THEN RETURN
2760 GOTO 5020 ! do ranged
2770 LOOT=LO0T(1,2)
2780 CALL POSITION(#1,YP,XP)
2790 IF XP>HX THEN 2800 ELSE RETURN
2800 CALL COINC(#1,#11,8,C)
2810 IF C<>0 THEN 2850
2820 CALL COINC(#1,#3,8,C)
2830 IF C<>0 THEN 5190 !check for hole level 2
2840 RETURN
2850 DET=11
2860 IF LOOT<>88 THEN 2880
2870 GOTO 5140 !do heart
2880 IF LOOT<>96 THEN 2900
2890 GOTO 5100 !do zed
2900 IF LOOT<>112 THEN 2920
2910 GOTO 5060 !do melee
2920 IF LOOT<>113 THEN RETURN
2930 GOTO 5020 ! do ranged
2940 IF YP<>57 THEN 3290 !level 3
2950 CALL POSITION(#4,HY,HX):: LOOT=LO0T(1,3)
2960 CALL POSITION(#1,YP,XP)
2970 IF XP<=HX THEN 2980 ELSE 3120
2980 CALL COINC(#1,#12,8,C)
2990 IF C<>0 THEN 3030
3000 CALL COINC(#1,#4,8,C)
3010 IF C<>0 THEN 5190 !check for hole level 3
3020 RETURN
3030 DET=12
3040 IF LOOT<>88 THEN 3060
3050 GOTO 5140 !do heart
3060 IF LOOT<>96 THEN 3080
3070 GOTO 5100 !do zed
3080 IF LOOT<>112 THEN 3100
3090 GOTO 5060 !do melee
3100 IF LOOT<>113 THEN RETURN
3110 GOTO 5020 ! do ranged
3120 LOOT=LO0T(1,4)
3130 CALL POSITION(#1,YP,XP)
3140 IF XP>HX THEN 3150 ELSE RETURN
3150 CALL COINC(#1,#13,8,C)
3160 IF C<>0 THEN 3200
3170 CALL COINC(#1,#4,8,C)
3180 IF C<>0 THEN 5190 !check for hole level 3
3190 RETURN
3200 DET=13
3210 IF LOOT<>88 THEN 3230
3220 GOTO 5140 !do heart
3230 IF LOOT<>96 THEN 3250
3240 GOTO 5100 !do zed
3250 IF LOOT<>112 THEN 3270
3260 GOTO 5060 !do melee
3270 IF LOOT<>113 THEN RETURN
3280 GOTO 5020 ! do ranged
3290 IF YP<>81 THEN 3640 !level 4
3300 CALL POSITION(#5,HY,HX):: :: LOOT=LO0T(1,5)
3310 CALL POSITION(#1,YP,XP)
3320 IF XP<=HX THEN 3330 ELSE 3470
3330 CALL COINC(#1,#14,8,C)
3340 IF C<>0 THEN 3380
3350 CALL COINC(#1,#5,8,C)
3360 IF C<>0 THEN 5190 !check for hole level 4
3370 RETURN
3380 DET=14
3390 IF LOOT<>88 THEN 3410
3400 GOTO 5140 !do heart
3410 IF LOOT<>96 THEN 3430
3420 GOTO 5100 !do zed
3430 IF LOOT<>112 THEN 3450
3440 GOTO 5060 !do melee
3450 IF LOOT<>113 THEN RETURN
3460 GOTO 5020 ! do ranged
3470 LOOT=LO0T(1,6)
3480 CALL POSITION(#1,YP,XP)
3490 IF XP>HX THEN 3500 ELSE RETURN
3500 CALL COINC(#1,#15,8,C)
3510 IF C<>0 THEN 3550
3520 CALL COINC(#1,#5,8,C)
3530 IF C<>0 THEN 5190 !check for hole level 4
3540 RETURN
3550 DET=15
3560 IF LOOT<>88 THEN 3580
3570 GOTO 5140 !do heart
3580 IF LOOT<>96 THEN 3600
3590 GOTO 5100 !do zed
3600 IF LOOT<>112 THEN 3620
3610 GOTO 5060 !do melee
3620 IF LOOT<>113 THEN RETURN
3630 GOTO 5020 ! do ranged
3640 IF YP<>105 THEN 3990 !level 5
3650 CALL POSITION(#6,HY,HX):: LOOT=LO0T(1,7)
3660 CALL POSITION(#1,YP,XP)::
3670 IF XP<=HX THEN 3680 ELSE 3820
3680 CALL COINC(#1,#16,8,C)
3690 IF C<>0 THEN 3730
3700 CALL COINC(#1,#6,8,C)
3710 IF C<>0 THEN 5190 !check for hole level 5
3720 RETURN
3730 DET=16
3740 IF LOOT<>88 THEN 3580
3750 GOTO 5140 !do heart
3760 IF LOOT<>96 THEN 3780
3770 GOTO 5100 !do zed
3780 IF LOOT<>112 THEN 3800
3790 GOTO 5060 !do melee
3800 IF LOOT<>113 THEN RETURN
3810 GOTO 5020 ! do ranged
3820 LOOT=LO0T(1, 8)
3830 CALL POSITION(#1,YP,XP)
3840 IF XP>HX THEN 3850 ELSE RETURN
3850 CALL COINC(#1,#17,8,C)
3860 IF C<>0 THEN 3900
3870 CALL COINC(#1,#6,8,C)
3880 IF C<>0 THEN 5190 !check for hole level 5
3890 RETURN
3900 DET=17
3910 IF LOOT<>88 THEN 3930
3920 GOTO 5140 !do heart
3930 IF LOOT<>96 THEN 3950
3940 GOTO 5100 !do zed
3950 IF LOOT<>112 THEN 3970
3960 GOTO 5060 !do melee
3970 IF LOOT<>113 THEN RETURN
3980 GOTO 5020 ! do ranged
3990 IF YP<>129 THEN 4340 !level 6
4000 CALL POSITION(#7,HY,HX):: LOOT=LO0T(1,9)
4010 CALL POSITION(#1,YP,XP)
4020 IF XP<=HX THEN 4030 ELSE 4170
4030 CALL COINC(#1,#18,8,C)
4040 IF C<>0 THEN 4080
4050 CALL COINC(#1,#7,8,C)
4060 IF C<>0 THEN 5190 !check for hole level 6
4070 RETURN
4080 DET=18
4090 IF LOOT<>88 THEN 4110
4100 GOTO 5140 !do heart
4110 IF LOOT<>96 THEN 4130
4120 GOTO 5100 !do zed
4130 IF LOOT<>112 THEN 4150
4140 GOTO 5060 !do melee
4150 IF LOOT<>113 THEN RETURN
4160 GOTO 5020 ! do ranged
4170 LOOT=LO0T(1,10)
4180 CALL POSITION(#1,YP,XP)
4190 IF XP>HX THEN 4200 ELSE RETURN
4200 CALL COINC(#1,#19,8,C)
4210 IF C<>0 THEN 4250
4220 CALL COINC(#1,#7,8,C)
4230 IF C<>0 THEN 5190 !check for hole level 6
4240 RETURN
4250 DET=19
4260 IF LOOT<>88 THEN 4280
4270 GOTO 5140 !do heart
4280 IF LOOT<>96 THEN 4300
4290 GOTO 5100 !do zed
4300 IF LOOT<>112 THEN 4320
4310 GOTO 5060 !do melee
4320 IF LOOT<>113 THEN RETURN
4330 GOTO 5020 ! do ranged
4340 IF YP<>153 THEN 4690 !level 7
4350 CALL POSITION(#8,HY,HX):: LOOT=LO0T(1,11)
4360 CALL POSITION(#1,YP,XP)
4370 IF XP<=HX THEN 4380 ELSE 4520
4380 CALL COINC(#1,#20,8,C)
4390 IF C<>0 THEN 4430
4400 CALL COINC(#1,#8,8,C)
4410 IF C<>0 THEN 5190 !check for hole level 7
4420 RETURN
4430 DET=20
4440 IF LOOT<>88 THEN 4460
4450 GOTO 5140 !do heart
4460 IF LOOT<>96 THEN 4480
4470 GOTO 5100 !do zed
4480 IF LOOT<>112 THEN 4500
4490 GOTO 5060 !do melee
4500 IF LOOT<>113 THEN RETURN
4510 GOTO 5020 ! do ranged
4520 LOOT=LO0T(1,12)
4530 CALL POSITION(#1,YP,XP)
4540 IF XP>HX THEN 4550 ELSE RETURN
4550 CALL COINC(#1,#21,8,C)
4560 IF C<>0 THEN 4600
4570 CALL COINC(#1,#8,8,C)
4580 IF C<>0 THEN 5190 !check for hole level 7
4590 RETURN
4600 DET=21
4610 IF LOOT<>88 THEN 4630
4620 GOTO 5140 !do heart
4630 IF LOOT<>96 THEN 4650
4640 GOTO 5100 !do zed
4650 IF LOOT<>112 THEN 4670
4660 GOTO 5060 !do melee
4670 IF LOOT<>113 THEN RETURN
4680 GOTO 5020 ! do ranged
4690 IF YP<>177 THEN RETURN !level 8 ground floor
4700 HX=LASTHLE :: LOOT=LO0T(1,13)
4710 CALL POSITION(#1,YP,XP)
4720 IF XP<=HX THEN 4730 ELSE 4860
4730 CALL COINC(#1,#22,8,C)
4740 IF C<>0 THEN 4770
4750 CALL COINC(#1,#9,4,C)
4760 IF C<>0 THEN 5210 ELSE RETURN !****collision check against exit
4770 DET=22
4780 IF LOOT<>88 THEN 4800
4790 GOTO 5140 !do heart
4800 IF LOOT<>96 THEN 4820
4810 GOTO 5100 !do zed
4820 IF LOOT<>112 THEN 4840
4830 GOTO 5060 !do melee
4840 IF LOOT<>113 THEN RETURN
4850 GOTO 5020 ! do ranged
4860 LOOT=LO0T(1,14)
4870 CALL POSITION(#1,YP,XP)
4880 IF XP>HX THEN 4890 ELSE RETURN
4890 CALL COINC(#1,#23,8,C)
4900 IF C<>0 THEN 4930
4910 CALL COINC(#1,#9,4,C)
4920 IF C<>0 THEN 5210 ELSE RETURN !****collision check against exit
4930 DET=23
4940 IF LOOT<>88 THEN 4960
4950 GOTO 5140 !do heart
4960 IF LOOT<>96 THEN 4980
4970 GOTO 5100 !do zed
4980 IF LOOT<>112 THEN 5000
4990 GOTO 5060 !do melee
5000 IF LOOT<>113 THEN RETURN
5010 GOTO 5020 ! do ranged
5020 REM **********ranged
5030 SCORE=SCORE+5 :: IF RANGED<10 THEN RANGED=RANGED+1:: CALL SOUND(1,1000,5)::CALL SOUND(1,1200,2)
5040 GOSUB 5750 !*************************gui UPDATE******
5050 GOTO 5170
5060 REM *********melee
5070 SCORE=SCORE+3 :: IF MELEE<10 THEN MELEE=MELEE+1:: CALL SOUND(1,1500,5)::CALL SOUND(1,1600,2)::
5080 GOSUB 5750 !*************************gui UPDATE******
5090 GOTO 5170
5100 REM *************zed
5110 CALL SOUND(100,-4,0,110,0,1000,0):: HEALTH=HEALTH-1 :: IF HEALTH<=0 THEN 5810
5120 GOSUB 5750 !*************************gui UPDATE******
5130 RETURN
5140 REM *************HEART
5150 SCORE=SCORE+8 :: CALL SOUND(1,500,5)::CALL SOUND(1,600,2)::IF HEALTH<10 THEN HEALTH=HEALTH+1
5160 GOSUB 5750 !*************************gui UPDATE******
5170 IF DET=O THEN 5180 :: CALL DELSPRITE(#DET):: RETURN
5180 RETURN
5190 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SOUND(1,666-(FALL*10),5):: CALL SPRITE(#1,44,6,YP,XP):: NEXT FALL !*****FALL**********
5200 RETURN
5210 REM *****************************************************BOARD**Progression************
5220 CALL DELSPRITE(ALL):: BOARD=BOARD+1 :: RESTORE 170 :: IF SCORE>HSCORE THEN HSCORE=SCORE :: GOTO 120
5230 REM ***********************************************************LOOT DISTRIBUTION SYSTEM******
5240 REM*******SWITCH=-5 !SWITCH=INT(RND*2)+1
5250 REM******FOR LT=1 TO 2
5260 LOOTL=INT(RND*4)+1
5270 LOOTR=INT(RND*4)+1
5280 REM******IF SWITCH=1 THEN 8860 ELSE 8880
5290 REM******SWITCH=-5::GOTO 8940
5300 REM******IF SWITCH=2 THEN 8900 ELSE 8920
5310 REM*********SWITCH=5::GOTO 8880
5320 REM******IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
5330 IF LOOTL<>1 THEN 5370
5340 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !HEART 88
5350 LO0T(LAB,LTN)=88 :: LAB=LAB+1
5360 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5370 IF LOOTL<>2 THEN 5410
5380 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !ZED 96
5390 LO0T(LAB,LTN)=96 :: LAB=LAB+1
5400 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5410 IF LOOTL<>3 THEN 5450
5420 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !MELEE 112
5430 LO0T(LAB,LTN)=112 :: LAB=LAB+1
5440 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5450 IF LOOTL<>4 THEN 5490
5460 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !RANGED 113
5470 LO0T(LAB,LTN)=113 :: LAB=LAB+1
5480 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5490 IF LOOTR<>1 THEN 5530
5500 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !HEART 88
5510 LO0T(LAB,LTN)=88 :: LAB=LAB+1
5520 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5530 IF LOOTR<>2 THEN 5570
5540 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !ZED 96
5550 LO0T(LAB,LTN)=96 :: LAB=LAB+1
5560 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5570 IF LOOTR<>3 THEN 5610
5580 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !MELEE 112
5590 LO0T(LAB,LTN)=112 :: LAB=LAB+1
5600 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5610 IF LOOTR<>4 THEN 5650
5620 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !RANGED 113
5630 LO0T(LAB,LTN)=113 :: LAB=LAB+1
5640 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5650 REM ***NEXT LT
5660 RETURN
5670 REM **********cOLLISION cHECK WALLs
5680 CALL POSITION(#1,YP,XP)
5690 IF XP<=12 THEN 5700 ELSE 5720
5700 CALL LOCATE(#1,YP,13):: CALL MOTION(#1,0,0)
5710 CALL JOYST(1,JX,JY):: IF JX=-4 THEN 5700 ELSE RETURN
5720 IF XP>=240 THEN 5730 ELSE RETURN
5730 CALL LOCATE(#1,YP,239):: CALL MOTION(#1,0,0)
5740 CALL JOYST(1,JX,JY):: IF JX=4 THEN 5730 ELSE RETURN
5750 REM ********************GUI Update***********
5760 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,10):BOARD :: DISPLAY AT(1,15):HEALTH :: DISPLAY AT(1,21):MELEE :: DISPLAY AT(1,26):RANGED !Output GUI
5770 CALL VCHAR(1,3,120):: CALL VCHAR(1,4,121):: CALL VCHAR(1,5,122)!score text gui
5780 CALL VCHAR(1,12,123):: CALL VCHAR(1,17,123):: CALL VCHAR(1,23,123):: CALL VCHAR(1,28,123)!Xs gui
5790 CALL VCHAR(1,11,124):: CALL VCHAR(1,16,88):: CALL VCHAR(1,22,112):: CALL VCHAR(1,27,113)!BOARD,hearts,melee,ranged gui
5800 RETURN
5810 REM ******************************YOU ARE DEAD***********************
5820 CALL MOTION(#1,0,0):: CALL DELSPRITE(ALL):: CALL SCREEN(10)
5830 DATA 89,0044442810101010,79,007C44444444447C,85,0044444444444438
5840 DATA 65,003844447C444444,82,0078444478504844,69,007C40407840407C
5850 DATA 68,0078242424242478
5860 FOR YAD=1 TO 7
5870 READ YADC,YADP$
5880 CALL CHAR(YADC,YADP$)
5890 NEXT YAD
5900 CALL CLEAR
5910 CALL VCHAR(12,10,89):: CALL VCHAR(12,11,79):: CALL VCHAR(12,12,85):: CALL VCHAR(12,13,32)!YOU
5920 CALL VCHAR(12,14,65):: CALL VCHAR(12,15,82):: CALL VCHAR(12,16,69):: CALL VCHAR(12,17,32)!ARE
5930 CALL VCHAR(12,18,68):: CALL VCHAR(12,19,69):: CALL VCHAR(12,20,65):: CALL VCHAR(12,21,68)!DEAD
5940 FOR CLRS=1 TO 13 :: CALL COLOR(CLRS,16,1):: NEXT CLRS
5950 CALL SCREEN(2)
5960 GOSUB 5750
5970 CALL KEY(1,K,S):: IF K=0 AND S=-1 THEN 6270 :: IF K=6 THEN 5980 ELSE 5990
5980 CALL DELSPRITE(ALL):: RESTORE 170 :: GOTO 100
5990 CALL JOYST(1,JX,JY):: IF JX=0 THEN 5970 :: IF JY=0 THEN 5970 ELSE 5980
6000 REM*******************MAN MELEE ATTACK
6010 CALL PATTERN(#1,45)!melee attack pattern
6020 CALL SPRITE(#24,143,12,YP,XP+ 8):: CALL SOUND(125,-5,0)!right attack
6030 GOSUB 6300 !MELLE HIT DETECTION RIGHT
6040 CALL DELSPRITE(#24)
6050 CALL SPRITE(#25,143,12,YP,XP- 8):: CALL SOUND(125,-6,0)!left attack
6060 GOSUB 6360 !MELEE HIT DETECTION LEFT
6070 CALL DELSPRITE(#25)
6080 CALL PATTERN(#1,44):: RETURN
6090 REM ******************MAN RANGED ATTACK
6100 CALL SOUND(100,-6,0):: RETURN
6110 !IF KSLOT=1 THEN 7090::RETURN
6120 !KSLOT=0::SLOT=SLOT-1::RETURN
6130 REM*****************ZED COINC BEHAVIOR*************
6140 RETURN
6150 REM****************ZED ATTACK******************
6160 RETURN
6170 REM *****JOYS Combat choice*****
6180 IF JY=4 AND MELEE>=1 THEN 6200 ELSE 6190
6190 CALL SOUND(100,-3,0):: RETURN
6200 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP)
6210 MELEE=MELEE-1 :: GOSUB 5750 !*******UPDATE GUI
6220 GOSUB 6000 !PERFORM MELEE ATTACK
6230 RETURN
6240 IF JY=-4 THEN 6250 ELSE 6260
6250 GOSUB 6100
6260 RETURN
6270 REM***quit game
6280 CALL CLEAR
6290 END
6300 !************************mELEE collision check against LOOT*********************
6310 REM FOR DETT=10 TO 23 !MELEE RIGHT
6320 CALL COINC(#24,#DET,7,C)
6330 IF C<>0 THEN 6410 ELSE 6340
6340 REM NEXT DETT
6350 RETURN
6360 REM FOR DETT=10 TO 23 !MELEE LEFT
6370 CALL COINC(#25,#DET,7,C)
6380 IF C<>0 THEN 6410 ELSE 6390
6390 REM NEXT DETT::
6400 RETURN
6410 TLOOP1=DET-9
6420 IF LO0T(1,TLOOP1)<>88 THEN 6430 ELSE 6510 !heart
6430 IF LO0T(1,TLOOP1)<>96 THEN 6480 !zed - ALL ALPHA TEMP CODE
6440 ZHELTH=ZHELTH-1 :: IF ZHELTH>=1 THEN 6520
6450 SCORE=SCORE+10 :: ZHELTH=2
6460 GOSUB 5750 !*****gui UPDATE******
6470 GOTO 6510
6480 IF LO0T(1,TLOOP1)<>112 THEN 6500 !melee
6490 GOTO 6510
6500 IF LO0T(1,TLOOP1)<>113 THEN 6520 !ranged
6510 CALL DELSPRITE(#DET):: RETURN
6520 RETURN
6530 GOTO 5060 !do melee

Edited by Sinphaltimus

Share this post


Link to post
Share on other sites


13882613_10206747180590105_7544198560067

ZOMBi v0.32



GAME IS CURRENTLY EARLY ACCESS ALPHA version. No ETA on Beta.

I will update this code below to the latest version when ever announced in a new comment so you don't have to go searching.
Just copy/paste from below OR download the class99 save dsk1.ZOMBI32 file and Extended BASIC text file that is attached here:

Zombti32.zip

How To Play:

About: This is meant to be a semi casual zombie survival game to escape a skyscraper. Play for score (session high score coming soon)

Combat: A melee attack is a swing attack that covers the space directly in front and behind the player. You get one attack per inventory item.
Joystick down = ranged attack temporarily using a noise for place holder.

ZEDS: Will grab you and attack you. Hold a direction to escape, try hitting with melee, break away as fast as you can.

DODGE: You can attempt to dodge zeds by jumping past them (joystick button or J)

LOOTING: Will slow you down, jump past it to dodge the loot if you need to (for future versions when Zombies run)

Controls:
X=Quit, R=Reset, J and Controller Button = Jump, Joystick Left/Right moves left/right,
Joystick up = melee attack -

Notes: Melee attacks will destroy loot including hearts. Be careful not to use up all your melee weapons.
Don't mash the jump button, press and hold.

V032 changes:
Fixed Melee COINC issue caused by me debugging unrelated things.
Added Zombie Hit indicator (Zombie flashes red when hit)
Added more sounds

To Do Next:
Create attacks for ranged including inventory changes
Replace temp zombi health with per sprite health. right now they share 2hps and it gets reset to 2 at each death.
Create basic zombie AI and animate.
session high score


KNOW ISSUES:
There are no known bugs at time of upload.
The code is bloated. A lot of fluff and stuff. I needed it this way to hunt bugs. I will optimize the code in a later version.
Not all functionality or game mechanics have been developed as of this version.

To Do Long Term:
Title screen.
Sounds
Music.
Session High Score
Loot balancing with board progression. (game balancing)
zombie difficulty linked to board progression.
At least 2 more types of ever more difficult zombies.


 



100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0
110 MELEE=0 :: RANGED=0 !weapons inventory
120 CALL SCREEN(2)
130 CALL COLOR(10,15,1):: CALL COLOR(12,12,1):: CALL COLOR(3,12,1):: CALL COLOR(4,12,1)
140 CALL COLOR(8,7,1):: CALL COLOR(11,8,1):: CALL COLOR(14,12,1):: HCLR=1
150 CALL CLEAR
160 !running patterns right
170 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
180 !stop and jump right
190 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
200 !jumping right
210 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
220 !landing right
230 DATA 0018183050180818,1818101038501018
240 !running patterns left
250 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
260 !stop and jump left
270 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
280 !jumping left
290 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
300 !landing right
310 DATA 0018180C0A181018,181808081C0A0818
320 FOR CHRR=33 TO 38 !setup for creating running characters right
330 READ PAT$
340 CALL CHAR(CHRR,PAT$)
350 NEXT CHRR
360 REM CHR=CHRR
370 FOR CHSR=39 TO 43 !setup for creating stop and jump characters right
380 READ PAT$
390 CALL CHAR(CHSR,PAT$)
400 NEXT CHSR
410 FOR CHJR=64 TO 67 !setup for creating jumping characters right
420 READ PAT$
430 CALL CHAR(CHJR,PAT$)
440 NEXT CHJR
450 FOR CHLR=68 TO 69 !setup for creating landing characters right
460 READ PAT$
470 CALL CHAR(CHLR,PAT$)
480 NEXT CHLR
490 REM left running***********************
500 FOR CHRL=70 TO 75 !setup for creating running characters left
510 READ PAT$
520 CALL CHAR(CHRL,PAT$)
530 NEXT CHRL
540 FOR CHSL=76 TO 80 !setup for creating stop and jump characters left
550 READ PAT$
560 CALL CHAR(CHSL,PAT$)
570 NEXT CHSL
580 FOR CHJL=81 TO 84 !setup for creating jumping characters left
590 READ PAT$
600 CALL CHAR(CHJL,PAT$)
610 NEXT CHJL
620 FOR CHLL=85 TO 86 !setup for creating landing characters left
630 READ PAT$
640 CALL CHAR(CHLL,PAT$)
650 NEXT CHLL
660 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
670 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
680 CALL CHAR(104,BGIR$,105,GIR$)!girder for level creation
690 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(106,GRAV$)!THE HOLE
700 EXT$="1F1111111D11111F" :: CALL CHAR(107,EXT$)!THE EXIT
710 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(88,HRT$)!THE HEART
720 ZED$="3C2418FF9918183C" :: CALL CHAR(96,ZED$)!THE ZED
730 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(112,MLE$)!MELEE
740 RNG$="000000FF7F1E1606" :: CALL CHAR(113,RNG$)!RANGED WEAPONS
750 SCTXT1$="70808063141414E3" :: SCTXT2$="00000000334A4A32" :: SCTXT3$="00000000993C2118" !Word Score
760 CALL CHAR(120,SCTXT1$):: CALL CHAR(121,SCTXT2$):: CALL CHAR(122,SCTXT3$)
770 EXTXT$="0044442810284444" :: CALL CHAR(123,EXTXT$)! the letter X remain for GUI
780 LVLTXT$="E0E080E9EF86EFE9" :: CALL CHAR(124,LVLTXT$)! EX TEXT IN GUI
790 IDLE$="3838107CBA38286C" :: CALL CHAR(44,IDLE$)!***IDLE MAN
800 MMELE$="3C3C18FF7E3C183C" :: MRNGL$="0C0C04FC4C3C286C" :: MRNGR$="3030203F323C1436" ! MELEE & l/r RANGED ATTACKS
810 MWA$="002418FF1824" :: BULET$="0000008" !WEAPONS FIRE
820 ZDI$="3C2418FF9918183C" :: ZDA$="3CA5DB7E1818183C" :: ZWL1$="3C2C18F81838246C" :: ZWL2$="3C2C18F818181838" !ZED IDLE&WALK LEFT
830 ZWR1$="3C34181F181C2436" :: ZWR2$="3C34181F1818181C" !ZED WALK RIGHT
840 CALL CHAR(45,MMELE$,46,MRNGL$,47,MRNGR$)!MAN ATTTACKS
850 CALL CHAR(143,MWA$,142,BULET$)!WEAPONS FIRE
860 RANDOMIZE
870 SLOT=10 !STARTING SPRITE NUMBER FOR LOOT and more
880 OPTION BASE 1
890 DIM LO0T(3,14)!LOOT DISTRIBUTION AND COLLISION.
900 LTN=1 !LOOT ARRAY COORDS COL
910 LAB=1 !LOOT ARRAY COORDS ROW
920 SHL=2 :: GRND=17 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
930 LVL=3 :: YP=9 :: XP=8 :: RS=0 :: CS=16 :: RSPD=2.0 :: RSPDD=3.3 !start pos,vel,controller run speed
940 ZHELTH=2 !default health of zombies start of game
950 GOSUB 2240 !*******************************Create Level
960 REM***************************************Create Sprite Idle********
970 CALL SPRITE(#1,44,6,YP,XP)::GOSUB 5600 !**********wall collision checks
980 CALL JOYST(1,JX,JY):: !check for joystick input
990 CALL KEY(1,K,S):: IF K=0 AND S=-1 THEN 6200 :: IF K=6 THEN 1000 ELSE 1010
1000 CALL DELSPRITE(ALL):: RESTORE 170 :: GOTO 100
1010 IF JY=0 THEN 1030 ELSE 1020 ! check for combat
1020 GOSUB 6100 ! goto combat
1030 IF JX=0 THEN 1070
1040 GOSUB 5600 !**********wall collision checks
1050 CALL COINC(ALL,C):: IF C=0 THEN 1070
1060 GOSUB 2460 !****************************collision checks
1070 CALL KEY(1,K,S):: IF K<>18 AND K<>74 AND K<>106 THEN 1740 !no kb pressed check for joyst
1080 REM ********jump routine check********
1090 CALL MOTION(#1,0,0)
1100 IF CS<>-16 THEN 1140
1110 CALL POSITION(#1,YP,XP)!get new position for next sprite
1120 GOSUB 1180 ! goto jump left
1130 GOTO 960
1140 IF CS<>16 THEN 1740
1150 CALL POSITION(#1,YP,XP)!get new position for next sprite
1160 GOSUB 1460 !goto jump right**************************
1170 GOTO 960
1180 REM *************jump left routine*********
1190 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1200 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1210 FOR PT=76 TO 80 !setup stop and jump animation left
1215 CALL SOUND(1,191-PT,5)
1220 CALL PATTERN(#1,PT)!ANIMATE
1230 !FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1240 !NEXT DELAY
1250 NEXT PT !continue animating the stop and jump until done
1260 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1270 IF XP<=24 THEN 1370
1280 CS=-20 :: YP=YP-3 :: RS=0 :: CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!jumping left
1290 FOR PT=81 TO 84
1300 CALL PATTERN(#1,PT)::CALL SOUND(1,110+PT,5)
1310 !FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1320 !NEXT DELAY
1330 NEXT PT
1340 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1350 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1360 YP=YP+3 !RESET YP TO BE GROUND.
1370 CALL SPRITE(#1,CHLL,6,YP,XP)
1380 FOR PT=85 TO 86 !setup landing animation left
1390 CALL PATTERN(#1,PT)::CALL SOUND(1,200-PT,5)
1400 !FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1410 !NEXT DELAY
1420 NEXT PT ! continue landing animation until last frame
1430 CALL POSITION(#1,YP,XP)!get new position for next sprite
1440 CS=-16
1450 RETURN
1460 REM *************jump right routine******
1470 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1480 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1490 FOR PT=39 TO 43 !setup stop and jump animation right
1495 CALL SOUND(1,191-(PT+37),5)
1500 CALL PATTERN(#1,PT)
1510 !FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1520 !NEXT DELAY
1530 NEXT PT !continue animating the stop and jump until done right
1540 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1550 IF XP>=224 THEN 1650
1560 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!jumping right
1570 FOR PT=64 TO 67 !setup jumping characters right
1580 CALL PATTERN(#1,PT)::CALL SOUND(1,110+(PT+13),5)
1590 !FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1600 !NEXT DELAY
1610 NEXT PT
1620 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1630 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1640 YP=YP+3
1650 CALL SPRITE(#1,CHLR,6,YP,XP)
1660 FOR PT=68 TO 69 !setup landing animation
1670 CALL PATTERN(#1,PT)::CALL SOUND(1,191-(PT+11),5)
1680 !FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1690 !NEXT DELAY
1700 NEXT PT ! continue landing animation until last frame
1710 CALL POSITION(#1,YP,XP)!get new position for next sprite
1720 CS=16
1730 RETURN
1740 REM **************Check Joyst Options************
1750 IF JX<>0 THEN 1780
1760 CALL MOTION(#1,0,0)
1770 GOTO 970
1780 REM ********running check***************
1790 IF JX<>-4 THEN 1810
1800 GOSUB 2040
1810 IF JX<>4 THEN 970
1820 GOSUB 1840
1830 GOTO 970 !after RETURN goto joyst check
1840 REM ************run right routine********
1850 CALL POSITION(#1,YP,XP):: CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP,0,JX*RSPD)!create the runner and send running
1860 FOR PT=33 TO 38 STEP 2 !setup for animating the run right
1870 CALL PATTERN(#1,PT)::call sound(1,-2,5)
1880 CALL KEY(1,K,S):: IF K=18 OR K=74 OR K=106 THEN 1080 !jump
1890 CALL JOYST(1,JX,JY):: !check for joystick input
1900 GOSUB 5600 !**********wall collision checks
1910 CALL COINC(ALL,C):: IF C=0 THEN 1920 :: CALL MOTION(#1,0,(JX*RSPD)/RSPDD):: GOSUB 2460 !collision actions
1920 IF JY=0 THEN 1940 ELSE 1930
1930 GOSUB 6100
1940 IF JX<>0 THEN 1960 ELSE 1950 !not joy pressed keep running
1950 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
1960 CALL JOYST(1,JX,JY)
1970 IF JX=4 THEN 1990
1980 IF JX=-4 THEN 2030
1990 CALL MOTION(#1,0,JX*RSPD)
2000 NEXT PT
2010 IF JX=4 THEN 1860
2020 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
2030 RETURN
2040 REM **********run left routine**************
2050 CALL POSITION(#1,YP,XP):: CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP,0,JX*RSPD)!create the runner and send running
2060 FOR PT=70 TO 75 STEP 2 !setup for animating the run left
2070 CALL PATTERN(#1,PT)::call sound(1,-2,5)
2080 CALL KEY(1,K,S):: IF K=18 OR K=74 OR K=106 THEN 1080 !jump
2090 CALL JOYST(1,JX,JY)!check for joystick input
2100 GOSUB 5600 !**********wall collision checks
2110 CALL COINC(ALL,C):: IF C=0 THEN 2120 :: CALL MOTION(#1,0,(JX*RSPD)/RSPDD):: GOSUB 2460 !collision actions
2120 IF JY=0 THEN 2140 ELSE 2130
2130 GOSUB 6100
2140 IF JX<>0 THEN 2160 !not joy pressed keep running
2150 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2160 CALL JOYST(1,JX,JY)
2170 IF JX=-4 THEN 2190
2180 IF JX=4 THEN 2230
2190 CALL MOTION(#1,0,JX*RSPD)
2200 NEXT PT
2210 IF JX=-4 THEN 2060
2220 CALL POSITION(#1,YP,XP)!check position and store for next sprite
2230 RETURN
2240 REM *************************************************************************level creation************************
2250 GOSUB 5680 !*************************gui creation******
2260 HLE=INT((RND*15)+5)
2270 FOR LVL=1 TO 8
2280 IF LVL=1 THEN 2300
2290 GOSUB 5160 !*************************************GOSUB********LOOT DS**********
2300 CALL VCHAR(1,1,105,24)!LEFT WALL
2310 CALL VCHAR(1,32,105,24)!RIGHT WALL
2320 CALL HCHAR(LVL*3,1,105,HLE-1)!LEFT SIDE GIRDERS
2330 IF LVL=8 THEN 2350 :: CALL SPRITE(#SHL,106,HCLR,GRND-8,(HLE* 8)+1)!HOLE PROPER
2340 SHL=SHL+1 !ADVANCE SPRITE #
2350 LASTHLE=(HLE* 8)+1 :: CALL HCHAR(LVL*3,HLE+3,105,32-(HLE+3))!RIGHT SIDE Girders
2360 IF LVL=8 THEN 2420 :: CALL HCHAR(LVL*3,HLE,104)!CRUMBLE LEFT SIDE
2370 CALL HCHAR(LVL*3,HLE+2,104)!crumble right side
2380 GRND=GRND+24
2390 HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2400 IF HOL=HLE THEN 2390 !NOT EQUAL TO PREVIOUS HOLE
2410 HLE=HOL !SET PROPER HOLE VARIABLE
2420 NEXT LVL !GO CREATE NEXT LEVEL
2430 CALL SPRITE(#9,107,15,22*8,30* 8)! THE EXIT
2440 CALL HCHAR(24,1,105,31)!THE FLOOR
2450 RETURN
2460 REM *********************************collision detection routines*******
2470 GOSUB 5600 !**********wall collision checks
2480 CALL POSITION(#1,YP,XP)
2490 IF YP<>9 THEN 2520 ! top level 1
2500 CALL COINC(#1,#2,8,C)
2510 IF C=0 THEN RETURN ELSE 5120 !check for hole level 1
2520 IF YP<>33 THEN 2870 !level 2
2530 CALL POSITION(#3,HY,HX):: LOOT=LO0T(1,1)
2540 CALL POSITION(#1,YP,XP)
2550 IF XP<=HX THEN 2560 ELSE 2700
2560 CALL COINC(#1,#10,8,C)
2570 IF C<>0 THEN 2610
2580 CALL COINC(#1,#3,8,C)
2590 IF C<>0 THEN 5120 !check for hole level 2
2600 RETURN
2610 DET=10
2620 IF LOOT<>88 THEN 2640
2630 GOTO 5070 !do heart
2640 IF LOOT<>96 THEN 2660
2650 GOTO 5030 !do zed
2660 IF LOOT<>112 THEN 2680
2670 GOTO 4990 !do melee
2680 IF LOOT<>113 THEN RETURN
2690 GOTO 4950 ! do ranged
2700 LOOT=LO0T(1,2)
2710 CALL POSITION(#1,YP,XP)
2720 IF XP>HX THEN 2730 ELSE RETURN
2730 CALL COINC(#1,#11,8,C)
2740 IF C<>0 THEN 2780
2750 CALL COINC(#1,#3,8,C)
2760 IF C<>0 THEN 5120 !check for hole level 2
2770 RETURN
2780 DET=11
2790 IF LOOT<>88 THEN 2810
2800 GOTO 5070 !do heart
2810 IF LOOT<>96 THEN 2830
2820 GOTO 5030 !do zed
2830 IF LOOT<>112 THEN 2850
2840 GOTO 4990 !do melee
2850 IF LOOT<>113 THEN RETURN
2860 GOTO 4950 ! do ranged
2870 IF YP<>57 THEN 3220 !level 3
2880 CALL POSITION(#4,HY,HX):: LOOT=LO0T(1,3)
2890 CALL POSITION(#1,YP,XP)
2900 IF XP<=HX THEN 2910 ELSE 3050
2910 CALL COINC(#1,#12,8,C)
2920 IF C<>0 THEN 2960
2930 CALL COINC(#1,#4,8,C)
2940 IF C<>0 THEN 5120 !check for hole level 3
2950 RETURN
2960 DET=12
2970 IF LOOT<>88 THEN 2990
2980 GOTO 5070 !do heart
2990 IF LOOT<>96 THEN 3010
3000 GOTO 5030 !do zed
3010 IF LOOT<>112 THEN 3030
3020 GOTO 4990 !do melee
3030 IF LOOT<>113 THEN RETURN
3040 GOTO 4950 ! do ranged
3050 LOOT=LO0T(1,4)
3060 CALL POSITION(#1,YP,XP)
3070 IF XP>HX THEN 3080 ELSE RETURN
3080 CALL COINC(#1,#13,8,C)
3090 IF C<>0 THEN 3130
3100 CALL COINC(#1,#4,8,C)
3110 IF C<>0 THEN 5120 !check for hole level 3
3120 RETURN
3130 DET=13
3140 IF LOOT<>88 THEN 3160
3150 GOTO 5070 !do heart
3160 IF LOOT<>96 THEN 3180
3170 GOTO 5030 !do zed
3180 IF LOOT<>112 THEN 3200
3190 GOTO 4990 !do melee
3200 IF LOOT<>113 THEN RETURN
3210 GOTO 4950 ! do ranged
3220 IF YP<>81 THEN 3570 !level 4
3230 CALL POSITION(#5,HY,HX):: :: LOOT=LO0T(1,5)
3240 CALL POSITION(#1,YP,XP)
3250 IF XP<=HX THEN 3260 ELSE 3400
3260 CALL COINC(#1,#14,8,C)
3270 IF C<>0 THEN 3310
3280 CALL COINC(#1,#5,8,C)
3290 IF C<>0 THEN 5120 !check for hole level 4
3300 RETURN
3310 DET=14
3320 IF LOOT<>88 THEN 3340
3330 GOTO 5070 !do heart
3340 IF LOOT<>96 THEN 3360
3350 GOTO 5030 !do zed
3360 IF LOOT<>112 THEN 3380
3370 GOTO 4990 !do melee
3380 IF LOOT<>113 THEN RETURN
3390 GOTO 4950 ! do ranged
3400 LOOT=LO0T(1,6)
3410 CALL POSITION(#1,YP,XP)
3420 IF XP>HX THEN 3430 ELSE RETURN
3430 CALL COINC(#1,#15,8,C)
3440 IF C<>0 THEN 3480
3450 CALL COINC(#1,#5,8,C)
3460 IF C<>0 THEN 5120 !check for hole level 4
3470 RETURN
3480 DET=15
3490 IF LOOT<>88 THEN 3510
3500 GOTO 5070 !do heart
3510 IF LOOT<>96 THEN 3530
3520 GOTO 5030 !do zed
3530 IF LOOT<>112 THEN 3550
3540 GOTO 4990 !do melee
3550 IF LOOT<>113 THEN RETURN
3560 GOTO 4950 ! do ranged
3570 IF YP<>105 THEN 3920 !level 5
3580 CALL POSITION(#6,HY,HX):: LOOT=LO0T(1,7)
3590 CALL POSITION(#1,YP,XP)::
3600 IF XP<=HX THEN 3610 ELSE 3750
3610 CALL COINC(#1,#16,8,C)
3620 IF C<>0 THEN 3660
3630 CALL COINC(#1,#6,8,C)
3640 IF C<>0 THEN 5120 !check for hole level 5
3650 RETURN
3660 DET=16
3670 IF LOOT<>88 THEN 3510
3680 GOTO 5070 !do heart
3690 IF LOOT<>96 THEN 3710
3700 GOTO 5030 !do zed
3710 IF LOOT<>112 THEN 3730
3720 GOTO 4990 !do melee
3730 IF LOOT<>113 THEN RETURN
3740 GOTO 4950 ! do ranged
3750 LOOT=LO0T(1, 8)
3760 CALL POSITION(#1,YP,XP)
3770 IF XP>HX THEN 3780 ELSE RETURN
3780 CALL COINC(#1,#17,8,C)
3790 IF C<>0 THEN 3830
3800 CALL COINC(#1,#6,8,C)
3810 IF C<>0 THEN 5120 !check for hole level 5
3820 RETURN
3830 DET=17
3840 IF LOOT<>88 THEN 3860
3850 GOTO 5070 !do heart
3860 IF LOOT<>96 THEN 3880
3870 GOTO 5030 !do zed
3880 IF LOOT<>112 THEN 3900
3890 GOTO 4990 !do melee
3900 IF LOOT<>113 THEN RETURN
3910 GOTO 4950 ! do ranged
3920 IF YP<>129 THEN 4270 !level 6
3930 CALL POSITION(#7,HY,HX):: LOOT=LO0T(1,9)
3940 CALL POSITION(#1,YP,XP)
3950 IF XP<=HX THEN 3960 ELSE 4100
3960 CALL COINC(#1,#18,8,C)
3970 IF C<>0 THEN 4010
3980 CALL COINC(#1,#7,8,C)
3990 IF C<>0 THEN 5120 !check for hole level 6
4000 RETURN
4010 DET=18
4020 IF LOOT<>88 THEN 4040
4030 GOTO 5070 !do heart
4040 IF LOOT<>96 THEN 4060
4050 GOTO 5030 !do zed
4060 IF LOOT<>112 THEN 4080
4070 GOTO 4990 !do melee
4080 IF LOOT<>113 THEN RETURN
4090 GOTO 4950 ! do ranged
4100 LOOT=LO0T(1,10)
4110 CALL POSITION(#1,YP,XP)
4120 IF XP>HX THEN 4130 ELSE RETURN
4130 CALL COINC(#1,#19,8,C)
4140 IF C<>0 THEN 4180
4150 CALL COINC(#1,#7,8,C)
4160 IF C<>0 THEN 5120 !check for hole level 6
4170 RETURN
4180 DET=19
4190 IF LOOT<>88 THEN 4210
4200 GOTO 5070 !do heart
4210 IF LOOT<>96 THEN 4230
4220 GOTO 5030 !do zed
4230 IF LOOT<>112 THEN 4250
4240 GOTO 4990 !do melee
4250 IF LOOT<>113 THEN RETURN
4260 GOTO 4950 ! do ranged
4270 IF YP<>153 THEN 4620 !level 7
4280 CALL POSITION(#8,HY,HX):: LOOT=LO0T(1,11)
4290 CALL POSITION(#1,YP,XP)
4300 IF XP<=HX THEN 4310 ELSE 4450
4310 CALL COINC(#1,#20,8,C)
4320 IF C<>0 THEN 4360
4330 CALL COINC(#1,#8,8,C)
4340 IF C<>0 THEN 5120 !check for hole level 7
4350 RETURN
4360 DET=20
4370 IF LOOT<>88 THEN 4390
4380 GOTO 5070 !do heart
4390 IF LOOT<>96 THEN 4410
4400 GOTO 5030 !do zed
4410 IF LOOT<>112 THEN 4430
4420 GOTO 4990 !do melee
4430 IF LOOT<>113 THEN RETURN
4440 GOTO 4950 ! do ranged
4450 LOOT=LO0T(1,12)
4460 CALL POSITION(#1,YP,XP)
4470 IF XP>HX THEN 4480 ELSE RETURN
4480 CALL COINC(#1,#21,8,C)
4490 IF C<>0 THEN 4530
4500 CALL COINC(#1,#8,8,C)
4510 IF C<>0 THEN 5120 !check for hole level 7
4520 RETURN
4530 DET=21
4540 IF LOOT<>88 THEN 4560
4550 GOTO 5070 !do heart
4560 IF LOOT<>96 THEN 4580
4570 GOTO 5030 !do zed
4580 IF LOOT<>112 THEN 4600
4590 GOTO 4990 !do melee
4600 IF LOOT<>113 THEN RETURN
4610 GOTO 4950 ! do ranged
4620 IF YP<>177 THEN RETURN !level 8 ground floor
4630 HX=LASTHLE :: LOOT=LO0T(1,13)
4640 CALL POSITION(#1,YP,XP)
4650 IF XP<=HX THEN 4660 ELSE 4790
4660 CALL COINC(#1,#22,8,C)
4670 IF C<>0 THEN 4700
4680 CALL COINC(#1,#9,4,C)
4690 IF C<>0 THEN 5140 ELSE RETURN !****collision check against exit
4700 DET=22
4710 IF LOOT<>88 THEN 4730
4720 GOTO 5070 !do heart
4730 IF LOOT<>96 THEN 4750
4740 GOTO 5030 !do zed
4750 IF LOOT<>112 THEN 4770
4760 GOTO 4990 !do melee
4770 IF LOOT<>113 THEN RETURN
4780 GOTO 4950 ! do ranged
4790 LOOT=LO0T(1,14)
4800 CALL POSITION(#1,YP,XP)
4810 IF XP>HX THEN 4820 ELSE RETURN
4820 CALL COINC(#1,#23,8,C)
4830 IF C<>0 THEN 4860
4840 CALL COINC(#1,#9,4,C)
4850 IF C<>0 THEN 5140 ELSE RETURN !****collision check against exit
4860 DET=23
4870 IF LOOT<>88 THEN 4890
4880 GOTO 5070 !do heart
4890 IF LOOT<>96 THEN 4910
4900 GOTO 5030 !do zed
4910 IF LOOT<>112 THEN 4930
4920 GOTO 4990 !do melee
4930 IF LOOT<>113 THEN RETURN
4940 GOTO 4950 ! do ranged
4950 REM **********ranged
4960 SCORE=SCORE+5 :: IF RANGED<10 THEN RANGED=RANGED+1 :: CALL SOUND(1,1000,5):: CALL SOUND(1,1200,2)
4970 GOSUB 5680 !*************************gui UPDATE******
4980 GOTO 5100
4990 REM *********melee
5000 SCORE=SCORE+3 :: IF MELEE<10 THEN MELEE=MELEE+1 :: CALL SOUND(1,1500,5):: CALL SOUND(1,1600,2)::
5010 GOSUB 5680 !*************************gui UPDATE******
5020 GOTO 5100
5030 REM *************zed
5040 CALL SOUND(100,-4,0,110,0,1000,0):: HEALTH=HEALTH-1 :: IF HEALTH<=0 THEN 5740
5050 GOSUB 5680 !*************************gui UPDATE******
5060 RETURN
5070 REM *************HEART
5080 SCORE=SCORE+8 :: CALL SOUND(1,500,5):: CALL SOUND(1,600,2):: IF HEALTH<10 THEN HEALTH=HEALTH+1
5090 GOSUB 5680 !*************************gui UPDATE******
5100 IF DET=O THEN 5110 :: CALL DELSPRITE(#DET):: RETURN
5110 RETURN
5115 rem*************FALL********
5120 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SOUND(1,666-(FALL*10),5):: CALL SPRITE(#1,44,6,YP,XP):: NEXT FALL
5130 RETURN
5140 REM *****************************************************BOARD**Progression************
5150 CALL DELSPRITE(ALL):: BOARD=BOARD+1 :: RESTORE 170 :: IF SCORE>HSCORE THEN HSCORE=SCORE :: GOTO 120
5160 REM ***********************************************************LOOT DISTRIBUTION SYSTEM******
5170 REM*******SWITCH=-5 !SWITCH=INT(RND*2)+1
5180 REM******FOR LT=1 TO 2
5190 LOOTL=INT(RND*4)+1
5200 LOOTR=INT(RND*4)+1
5210 REM******IF SWITCH=1 THEN 8860 ELSE 8880
5220 REM******SWITCH=-5::GOTO 8940
5230 REM******IF SWITCH=2 THEN 8900 ELSE 8920
5240 REM*********SWITCH=5::GOTO 8880
5250 REM******IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
5260 IF LOOTL<>1 THEN 5300
5270 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !HEART 88
5280 LO0T(LAB,LTN)=88 :: LAB=LAB+1
5290 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5300 IF LOOTL<>2 THEN 5340
5310 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !ZED 96
5320 LO0T(LAB,LTN)=96 :: LAB=LAB+1
5330 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5340 IF LOOTL<>3 THEN 5380
5350 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !MELEE 112
5360 LO0T(LAB,LTN)=112 :: LAB=LAB+1
5370 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5380 IF LOOTL<>4 THEN 5420
5390 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)* 8)-40):: SLOT=SLOT+1 !RANGED 113
5400 LO0T(LAB,LTN)=113 :: LAB=LAB+1
5410 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5420 IF LOOTR<>1 THEN 5460
5430 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !HEART 88
5440 LO0T(LAB,LTN)=88 :: LAB=LAB+1
5450 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5460 IF LOOTR<>2 THEN 5500
5470 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !ZED 96
5480 LO0T(LAB,LTN)=96 :: LAB=LAB+1
5490 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5500 IF LOOTR<>3 THEN 5540
5510 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !MELEE 112
5520 LO0T(LAB,LTN)=112 :: LAB=LAB+1
5530 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5540 IF LOOTR<>4 THEN 5580
5550 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)* 8)+40):: SLOT=SLOT+1 !RANGED 113
5560 LO0T(LAB,LTN)=113 :: LAB=LAB+1
5570 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
5580 REM ***NEXT LT
5590 RETURN
5600 REM **********cOLLISION cHECK WALLs
5610 CALL POSITION(#1,YP,XP)
5620 IF XP<=12 THEN 5630 ELSE 5650
5630 CALL LOCATE(#1,YP,13):: CALL MOTION(#1,0,0)
5640 CALL JOYST(1,JX,JY):: IF JX=-4 THEN 5630 ELSE RETURN
5650 IF XP>=240 THEN 5660 ELSE RETURN
5660 CALL LOCATE(#1,YP,239):: CALL MOTION(#1,0,0)
5670 CALL JOYST(1,JX,JY):: IF JX=4 THEN 5660 ELSE RETURN
5680 REM ********************GUI Update***********
5690 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,10):BOARD :: DISPLAY AT(1,15):HEALTH :: DISPLAY AT(1,21):MELEE :: DISPLAY AT(1,26):RANGED !Output GUI
5700 CALL VCHAR(1,3,120):: CALL VCHAR(1,4,121):: CALL VCHAR(1,5,122)!score text gui
5710 CALL VCHAR(1,12,123):: CALL VCHAR(1,17,123):: CALL VCHAR(1,23,123):: CALL VCHAR(1,28,123)!Xs gui
5720 CALL VCHAR(1,11,124):: CALL VCHAR(1,16,88):: CALL VCHAR(1,22,112):: CALL VCHAR(1,27,113)!BOARD,hearts,melee,ranged gui
5730 RETURN
5740 REM ******************************YOU ARE DEAD***********************
5750 CALL MOTION(#1,0,0):: CALL DELSPRITE(ALL):: CALL SCREEN(10)
5760 DATA 89,0044442810101010,79,007C44444444447C,85,0044444444444438
5770 DATA 65,003844447C444444,82,0078444478504844,69,007C40407840407C
5780 DATA 68,0078242424242478
5790 FOR YAD=1 TO 7
5800 READ YADC,YADP$
5810 CALL CHAR(YADC,YADP$)
5820 NEXT YAD
5830 CALL CLEAR
5840 CALL VCHAR(12,10,89):: CALL VCHAR(12,11,79):: CALL VCHAR(12,12,85):: CALL VCHAR(12,13,32)!YOU
5850 CALL VCHAR(12,14,65):: CALL VCHAR(12,15,82):: CALL VCHAR(12,16,69):: CALL VCHAR(12,17,32)!ARE
5860 CALL VCHAR(12,18,68):: CALL VCHAR(12,19,69):: CALL VCHAR(12,20,65):: CALL VCHAR(12,21,68)!DEAD
5870 FOR CLRS=1 TO 13 :: CALL COLOR(CLRS,16,1):: NEXT CLRS
5880 CALL SCREEN(2)
5890 GOSUB 5680
5900 CALL KEY(1,K,S):: IF K=0 AND S=-1 THEN 6200 :: IF K=6 THEN 5910 ELSE 5920
5910 CALL DELSPRITE(ALL):: RESTORE 170 :: GOTO 100
5920 CALL JOYST(1,JX,JY):: IF JX=0 THEN 5900 :: IF JY=0 THEN 5900 ELSE 5910
5930 REM*******************MAN MELEE ATTACK
5940 CALL PATTERN(#1,45)!melee attack pattern
5950 CALL SPRITE(#24,143,12,YP,XP+ 8):: CALL SOUND(125,-5,0)!right attack
5960 GOSUB 6230 !MELLE HIT DETECTION RIGHT
5970 CALL DELSPRITE(#24)
5980 CALL SPRITE(#25,143,12,YP,XP- 8):: CALL SOUND(125,-6,0)!left attack
5990 GOSUB 6290 !MELEE HIT DETECTION LEFT
6000 CALL DELSPRITE(#25)
6010 CALL PATTERN(#1,44):: CALL COLOR(#DET,4):: RETURN
6020 REM ******************MAN RANGED ATTACK
6030 CALL SOUND(100,-6,0):: RETURN
6040 !IF KSLOT=1 THEN 7090::RETURN
6050 !KSLOT=0::SLOT=SLOT-1::RETURN
6060 REM*****************ZED COINC BEHAVIOR*************
6070 RETURN
6080 REM****************ZED ATTACK******************
6090 RETURN
6100 REM *****JOYS Combat choice*****
6110 IF JY=4 AND MELEE>=1 THEN 6130 ELSE 6120
6120 CALL SOUND(100,-3,0):: RETURN
6130 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP)
6140 MELEE=MELEE-1 :: GOSUB 5680 !*******UPDATE GUI
6150 GOSUB 5930 !PERFORM MELEE ATTACK
6160 RETURN
6170 IF JY=-4 THEN 6180 ELSE 6190
6180 GOSUB 6030
6190 RETURN
6200 REM***quit game
6210 CALL CLEAR
6220 END
6230 !************************mELEE collision check against LOOT*********************
6240 FOR DET=10 TO 23 !MELEE RIGHT
6250 CALL COINC(#24,#DET,7,C)
6260 IF C<>0 THEN 6340 ELSE 6270
6270 NEXT DET
6280 RETURN
6290 FOR DET=10 TO 23 !MELEE LEFT
6300 CALL COINC(#25,#DET,7,C)
6310 IF C<>0 THEN 6340 ELSE 6320
6320 NEXT DET
6330 RETURN
6340 TLOOP1=DET-9
6350 IF LO0T(1,TLOOP1)<>88 THEN 6360 ELSE 6440 !heart
6360 IF LO0T(1,TLOOP1)<>96 THEN 6410 !zed - ALL ALPHA TEMP CODE
6370 CALL COLOR(#DET,7):: ZHELTH=ZHELTH-1 :: IF ZHELTH>=1 THEN 6450
6380 SCORE=SCORE+10 :: ZHELTH=2
6390 GOSUB 5680 !*****gui UPDATE******
6400 GOTO 6440
6410 IF LO0T(1,TLOOP1)<>112 THEN 6430 !melee
6420 GOTO 6440
6430 IF LO0T(1,TLOOP1)<>113 THEN 6450 !ranged
6440 CALL DELSPRITE(#DET):: RETURN
6450 RETURN
6460 GOTO 4990 !do melee








14046125_10206754129283818_5107071143118

Edited by Sinphaltimus
  • Like 1

Share this post


Link to post
Share on other sites

HA! Working on V33 and I ran out of memory! LOL, Yeah. OK, I guess I have to start optimizing now; stripping out redundant code, combining commands and command lines and removing a ton of comments no longer needed.

This will take a while and I can only work on it after my real job so new update in a couple of days.

I've implemented the ranged weapon, you can now shoot zombies! :)

  • Like 1

Share this post


Link to post
Share on other sites

... and removing a ton of comments no longer needed.

You could let a lot of comments stay in your source text-file like this:

 

! This should clear the screen
100 CALL CLEAR
! And this turns it all red
110 CALL SCREEN(7)
REM And this loops forever
120 GOTO 120
 

When you copy and paste to Classic99, Classic99 will ignore the lines beginning with the markers for remarks/comments. ! seems to be ignored quicker than REM when you use "Paste XB".

 

;)

Edited by sometimes99er
  • Like 1

Share this post


Link to post
Share on other sites

You could let a lot of comments stay in your source text-file like this:

 

 

! This should clear the screen
100 CALL CLEAR
! And this turns it all red
110 CALL SCREEN(7)
REM And this loops forever
120 GOTO 120
 
When you copy and paste to Classic99. Classic99 will ignore the lines beginning with the markers for remarks/comments. ! seems to be ignored quicker than REM when you use "Paste XB".

 

;)

 

 

Wait what?!?

 

If I out all my comments on their own line starting with an exclamation, Classic does not paste those lines when I chippy and paste all!?!?!?

 

Wow man, thank you so much for that tid bit. That will save me about 30 percent of the total code base alone.

 

I will be at it after work today.

 

Thank you thank you thank you.

  • Like 1

Share this post


Link to post
Share on other sites

Yep, this is true. I use Notepad++ and have large blocks of rem statements between chunks of code. Just put the (!) in front of them and they do not go to memory in XB when pasted. You can see them get pasted, but they are not retained in memory, and you cannot see them when you LIST the program.

  • Like 1

Share this post


Link to post
Share on other sites

I discovered notepad++ just 2 weeks ago when Notepad almost caused me to put my fist through my monitor.

 

I re-commented all my code during lunch today. I found that I have about 4k in comments.

 

I know I can ramble on but 4k? Damn...

Share this post


Link to post
Share on other sites

Jedi Gauntlet is about 10k right now, with 12k of comments.

 

Paragraphs of development comments between code segments

  • Like 2

Share this post


Link to post
Share on other sites

Yep, this is true. I use Notepad++ and have large blocks of rem statements between chunks of code. Just put the (!) in front of them and they do not go to memory in XB when pasted. You can see them get pasted, but they are not retained in memory, and you cannot see them when you LIST the program.

 

I discovered notepad++ just 2 weeks ago when Notepad almost caused me to put my fist through my monitor. ...

 

Yeah, I've been using Notepad++ ever since I started converting/enhancing TI Forth into my flie-based fbForth 1.0 and cartridge-resident fbForth 2.0 more than three years ago. It is a great programmer's editor!

 

...lee

Share this post


Link to post
Share on other sites

Looking at your code, there is room to optimize your set-up. You are using a LOT of loops and lines to set up character patterns. Remember that Extended BASIC can define up to 4 consecutive characters at a time in a single CHAR statement, so you could structure it like this:

 

100 FOR I=1 TO 10 :: READ C,C$ :: CALL CHAR(C,C$):: NEXT I

...

! 96 - Zed, 97 - ...

10000 DATA 96,FFF...

10010 DATA 100,FFF...

 

This will reclaim a LOT of code space and let you use the comments to remind yourself which pattern is which character.

Share this post


Link to post
Share on other sites

The only downside I see to this method is resequencing and list "clip".

You could perhaps have a two column format in your text editor or simply use a spreadsheet.

 

First column has your code, - that's one line-number and program statements per line (row). Second column has you comments.

 

Copy first column to Classic99. Resequence and list "clip". Copy resequenced code and paste in first column. Shouldn't it line up with your old comments ?

 

;)

 

comments.png

Edited by sometimes99er
  • Like 1

Share this post


Link to post
Share on other sites

For example, a small snippet of optimized pattern code:

100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0 :: MELEE=0 :: RANGED=0
120 CALL SCREEN(2):: CALL COLOR(3,12,1,4,12,1,8,7,1,10,15,1,11,8,1,12,12,1,14,12,1):: HCLR=1 :: CALL CLEAR
130 FOR I=1 TO 53 :: READ C,C$ :: CALL CHAR(C,C$):: NEXT I

140 DATA 33,1818101010101018,34,1818183C1C142630,35,181A3C5E1A334060,36,18197E981C724100,37,18197E9818147243,38,1818385E581C2436
150 DATA 39,1818101010101018,40,000C1C3058081018,41,00000C1C305C1C18,42,0000060E183C0C18,43,0003070C18081018
160 DATA 64,0303040609081010,65,1818141810106000,66,1818103810180C00,67,1818503010180404
170 DATA 68,0018183050180818,69,1818101038501018
180 DATA 70,1818080808080818,71,1818183C3828640C,72,18583C7A58CC0206,73,18987E19384E8200,74,18987E1918284EC2,75,18181C7A1A38246C
190 DATA 76,1818080808080818,77,0030380C1A100818,78,000030380C3A3818,79,00006070183C3018,80,00C0E03018100818
200 DATA 81,C0C0206090100808,82,1818281808080600,83,1818081C08183000,84,18180A0C08182020
210 DATA 85,0018180C0A181018,86,181808081C0A0818
220 DATA 104,3C4426D999A5C3FF,105,FFC3A59999A5C3FF,106,FFFFFFFFFFFFFFFF,107,1F1111111D11111F,88,66FFFFFF7E7E3C18
230 DATA 96,3C2418FF9918183C,112,C0E0703A1E0C1A01,113,000000FF7F1E1606,120,70808063141414E3,121,00000000334A4A32,122,00000000993C2118
240 DATA 123,0044442810284444,124,E0E080E9EF86EFE9,44,3838107CBA38286C,45,3C3C18FF7E3C183C,46,0C0C04FC4C3C286C,47,3030203F323C1436
250 DATA 143,002418FF1824,142,0000008

860 RANDOMIZE
  • Like 1

Share this post


Link to post
Share on other sites

You could perhaps have a two column format in your text editor or simply use a spreadsheet.

 

First column has your code, - that's one line-number and program statements per line (row). Second column has you comments.

 

Copy first column to Classic99. Resequence and list "clip". Copy resequenced code and paste in first column. Shouldn't it line up with your old comments ?

 

;)

 

comments.png

 

 

Yep, notepad++ is perfect for this. I thought about it after posting that "downside" comment.

Share this post


Link to post
Share on other sites

I would probably have written the lines 160-850 like this ... ;)

160 CALL CHAR(33,"18181010101010181818183C1C142630181A3C5E1A33406")
170 CALL CHAR(36,"18197E981C72410018197E98181472431818385E581C24361818101010101018")
180 CALL CHAR(40,"000C1C305808101800000C1C305C1C180000060E183C0C180003070C18081018")
190 CALL CHAR(44,"3838107CBA38286C3C3C18FF7E3C183C0C0C04FC4C3C286C3030203F323C1436")
200 CALL CHAR(64,"030304060908101018181418101060001818103810180C001818503010180404")
210 CALL CHAR(68,"0018183050180818181810103850101818180808080808181818183C3828640C")
220 CALL CHAR(72,"18583C7A58CC020618987E19384E820018987E1918284EC218181C7A1A38246C")
230 CALL CHAR(76,"18180808080808180030380C1A100818000030380C3A381800006070183C3018")
240 CALL CHAR(80,"00C0E03018100818C0C020609010080818182818080806001818081C08183")
250 CALL CHAR(84,"18180A0C081820200018180C0A181018181808081C0A08180")
260 CALL CHAR(88,"66FFFFFF7E7E3C18")
270 CALL CHAR(96,"3C2418FF9918183C")
280 CALL CHAR(104,"3C4426D999A5C3FFFFC3A59999A5C3FFFFFFFFFFFFFFFFFF1F1111111D11111F")
290 CALL CHAR(112,"C0E0703A1E0C1A01000000FF7F1E1606")
300 CALL CHAR(120,"70808063141414E300000000334A4A3200000000993C2118")
310 CALL CHAR(124,"E0E080E9EF86EFE9")
320 CALL CHAR(142,"0000008000000000002418FF1824")
  
  • Like 1

Share this post


Link to post
Share on other sites

 

For example, a small snippet of optimized pattern code:

100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0 :: MELEE=0 :: RANGED=0
120 CALL SCREEN(2):: CALL COLOR(3,12,1,4,12,1,8,7,1,10,15,1,11,8,1,12,12,1,14,12,1):: HCLR=1 :: CALL CLEAR
130 FOR I=1 TO 53 :: READ C,C$ :: CALL CHAR(C,C$):: NEXT I

140 DATA 33,1818101010101018,34,1818183C1C142630,35,181A3C5E1A334060,36,18197E981C724100,37,18197E9818147243,38,1818385E581C2436
150 DATA 39,1818101010101018,40,000C1C3058081018,41,00000C1C305C1C18,42,0000060E183C0C18,43,0003070C18081018
160 DATA 64,0303040609081010,65,1818141810106000,66,1818103810180C00,67,1818503010180404
170 DATA 68,0018183050180818,69,1818101038501018
180 DATA 70,1818080808080818,71,1818183C3828640C,72,18583C7A58CC0206,73,18987E19384E8200,74,18987E1918284EC2,75,18181C7A1A38246C
190 DATA 76,1818080808080818,77,0030380C1A100818,78,000030380C3A3818,79,00006070183C3018,80,00C0E03018100818
200 DATA 81,C0C0206090100808,82,1818281808080600,83,1818081C08183000,84,18180A0C08182020
210 DATA 85,0018180C0A181018,86,181808081C0A0818
220 DATA 104,3C4426D999A5C3FF,105,FFC3A59999A5C3FF,106,FFFFFFFFFFFFFFFF,107,1F1111111D11111F,88,66FFFFFF7E7E3C18
230 DATA 96,3C2418FF9918183C,112,C0E0703A1E0C1A01,113,000000FF7F1E1606,120,70808063141414E3,121,00000000334A4A32,122,00000000993C2118
240 DATA 123,0044442810284444,124,E0E080E9EF86EFE9,44,3838107CBA38286C,45,3C3C18FF7E3C183C,46,0C0C04FC4C3C286C,47,3030203F323C1436
250 DATA 143,002418FF1824,142,0000008

860 RANDOMIZE

 

 

Yes, absolutely. I wasn't counting on running out of memory this soon and was not optimizing any of my code as much as I could be.

I'm going to take care of all this right now so I know what I have left to work with as far as what I need to finish this game and/or add additional features.

 

I don't even need most of those call colors. I have them there as reference from very early on. I'm doing most of my color calls at the call sprite level. I really left a mess behind for myself, but then again, I wasn't planning on making a game either. I was just animating a little running man is all, then all of a sudden THIS happened.

  • Like 1

Share this post


Link to post
Share on other sites

 

I would probably have written the lines 160-850 like this ... ;)

 

160 CALL CHAR(33,"18181010101010181818183C1C142630181A3C5E1A33406")
170 CALL CHAR(36,"18197E981C72410018197E98181472431818385E581C24361818101010101018")
180 CALL CHAR(40,"000C1C305808101800000C1C305C1C180000060E183C0C180003070C18081018")
190 CALL CHAR(44,"3838107CBA38286C3C3C18FF7E3C183C0C0C04FC4C3C286C3030203F323C1436")
200 CALL CHAR(64,"030304060908101018181418101060001818103810180C001818503010180404")
210 CALL CHAR(68,"0018183050180818181810103850101818180808080808181818183C3828640C")
220 CALL CHAR(72,"18583C7A58CC020618987E19384E820018987E1918284EC218181C7A1A38246C")
230 CALL CHAR(76,"18180808080808180030380C1A100818000030380C3A381800006070183C3018")
240 CALL CHAR(80,"00C0E03018100818C0C020609010080818182818080806001818081C08183")
250 CALL CHAR(84,"18180A0C081820200018180C0A181018181808081C0A08180")
260 CALL CHAR(88,"66FFFFFF7E7E3C18")
270 CALL CHAR(96,"3C2418FF9918183C")
280 CALL CHAR(104,"3C4426D999A5C3FFFFC3A59999A5C3FFFFFFFFFFFFFFFFFF1F1111111D11111F")
290 CALL CHAR(112,"C0E0703A1E0C1A01000000FF7F1E1606")
300 CALL CHAR(120,"70808063141414E300000000334A4A3200000000993C2118")
310 CALL CHAR(124,"E0E080E9EF86EFE9")
320 CALL CHAR(142,"0000008000000000002418FF1824")
  

That also works, although you ARE burning up bytes for every CALL CHAR there... that's why a loop is more efficient code-wise. :)

Share this post


Link to post
Share on other sites

That also works, although you ARE burning up bytes for every CALL CHAR there... that's why a loop is more efficient code-wise. :)

 

And his kind of optimization needs to wait until the very last steps. Even the use of loops. I'm not completely sold on all the graphics yet. I maybe changing all of them so you can imagine it's easier for me to leave my bloat (in this area) alone until I commit to the artwork.

Share this post


Link to post
Share on other sites

That also works, although you ARE burning up bytes for every CALL CHAR there... that's why a loop is more efficient code-wise. :)

 

Yep, the letters C, H, A and R are stored as is and not as a one byte token. On the other hand, I'm not burning bytes on a loop and on as many ASCII codes as in your code. ;)

Edited by sometimes99er

Share this post


Link to post
Share on other sites

 

Yep, the letters C, H, A and R are stored as is and not as a one byte token. On the other hand, I'm not burning bytes on a loop and on as many ASCII codes as in your code. ;)

 

Not my fault, his patterns are scattered all around. Ideally you'd want to stack your patterns in a more efficient manner, which as he's indicated, is something for the future. :)

Share this post


Link to post
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.

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...