Subject: Game code

From: Owen Brand <[email-masked]>
Date: Wed, 27 Jan 2010 21:27:06 -0500

Here is the game code.. I have left out the title screen and all the  
complex COINC functions that are eating my memory.... What is here is  
a simple game screen with 2 enemy SPRITEs with which you can collide--- 
setting off a coincidence (ALL)....  You will notice that the spaces  
immediately before and immediately following any displayed variable on  
the screen are that of the background and not the cyan(8) sky....  I  
have also not yet implemented a scoring engine, as that is tied in  
directly to the honeycomb graphics.... Although, I could just display  
a fixed point that could be reached, adding to the variable "SCO"  
which is my score variable.  Anyway, just as a little demo, paste this  
into Classic99 and take a gander...  Hope you like the flower  
pattern.... :)  With a little help (or not so little) from Karsten, I  
was able to draw the entire bed using only 5 lines!!!

Owen Brand
**Oprysoft**
Opry99er.com

MAIN GAME SCREEN

550 CALL CLEAR :: CALL SCREEN(2) :: CALL CHARSET :: CALL DELSPRITE(ALL)
560 REM  **INIT VARIABLES**
570 Q=3 :: LEV=1 :: DSPD=10 :: D=6 :: SCO=0
580 REM  ** INIT CUSTOM CHARACTERS **
590 FTL$="0000001E1F1F1F0F"
600 FT$="173C3C7E7E3C18BD"
610 FTR$="00000078F8F8F8F0"
620 FL$="01187DFFFF7D1801"
630 FC$="3C4EBEFFFFFF7E3C"
640 FR$="8018BEFFFFBE1880"
650 FBL$="0F1F1F1F1E"
660 FB$="BD183C7E7E3C3C18"
670 FBR$="F0F8F8F878"
680 ST$="1818181818181818"
690 CALL CHAR(33,ST$,88,FTL$,89,FT$,90,FTR$,91,FL$,92,FR$,93,FBL$,94,FB 
$,95,FBR$,40,FC$)
700 CALL CHAR(136,"FFFFFFFFFFFFFFFF")
710 A$=CHR$(88)&CHR$(89)&CHR$(90)&CHR$(33) :: B$=CHR$(91)&CHR$(40)&CHR$ 
(92)&CHR$(33)
720 C$=CHR$(93)&CHR$(94)&CHR$(95)&CHR$(33)
730 FOR R=0 TO 1 :: FOR C=0 TO 5
740 CALL HCHAR(1,1,136,224)
750 DISPLAY AT(R*3+19,C*4-R*2+5):SEG$(A$,1,3+R);
760 DISPLAY AT(R*3+20,C*4-R*2+5):SEG$(B$,1,3+R);
770 DISPLAY AT(R*3+21,C*4-R*2+5):SEG$(C$,1,3+R);
780 NEXT C :: NEXT R
790 RESTORE 1220
800 FOR SP=96 TO 132 STEP 4 :: READ SP$ :: CALL CHAR(SP,SP$) :: NEXT SP
810 CALL HCHAR(1,1,136,224) :: CALL COLOR 
(3,2,8,4,2,8,5,2,8,6,2,8,7,2,8,14,8,1,8,16,1,2,9,16) :: CALL SCREEN(11)
820 CALL SPRITE(#1,100,2,170,5) :: CALL SPRITE(#2,112,7,99,150,0,-15)
830 CALL SPRITE(#4,112,7,75,125,0,-15)
840 CALL SPRITE(#3,96,2,10,5,0,20)
850 CALL MAGNIFY(3)
860 DISPLAY AT(3,21):Q;
870 DISPLAY AT(1,16):"LEVEL"; :: DISPLAY AT(1,22):LEV;
880 DISPLAY AT(2,2):SCO;
890 DISPLAY AT(1,21):CHR$(136);
900 CALL POSITION(#1,XPOS,YPOS)
910 IF XPOS>185 THEN GOSUB 1180
920 IF YPOS<10 THEN GOSUB 1200
930 IF XPOS<58 THEN GOSUB 1190
940 CALL JOYST(1,X,Y)
950 CALL KEY(1,KKK,SSS) :: IF KKK=18 THEN FG=1
960 CALL MOTION(#1,-Y*2.5,X*2.5)
970 CALL PATTERN(#1,Y*3+X+116)
980 CALL COINC(ALL,C) :: IF C=-1 THEN GOTO 1000
990 GOTO 900
1000 REM  ** SPIN BEE & FLASH SCREEN **
1010 CALL DELSPRITE(ALL) :: CALL SPRITE(#1,100,2,90,120) :: CALL MOTION 
(#1,0,0) :: RESTORE 1330
1020 FOR DEAD=1 TO 8
1030 READ SPIN :: CALL PATTERN(#1,SPIN)
1040 CALL SCREEN(7) :: FOR DELAY=1 TO 10 :: NEXT DELAY
1050 READ SPIN :: CALL PATTERN(#1,SPIN)
1060 CALL SCREEN(8) :: FOR DELAY=1 TO 10 :: NEXT DELAY
1070 NEXT DEAD
1080 Q=Q-1 :: IF Q<0 THEN GOTO 1150
1090 CALL SCREEN(7) :: DISPLAY AT(6,8):"OOPS"; :: DISPLAY AT 
(6,13):"BE"; :: DISPLAY AT(6,16):"CAREFUL";
1100 FOR X=1 TO 400 :: NEXT X
1110 CALL SCREEN(2) :: DISPLAY AT(7,10):"HERE"; :: DISPLAY AT 
(7,15):"WE"; :: DISPLAY AT(7,18):"GO"; :: CALL SCREEN(7)
1120 FOR X=1 TO 400 :: NEXT X
1130 CALL SCREEN(2)
1140 GOTO 810
1150 CALL CLEAR
1160 FOR L=1 TO 16
1170 FOR X=1 TO 30 :: NEXT X :: PRINT "GAME OVER" :: CALL SCREEN(L) ::  
NEXT L :: CALL CHARSET :: CALL CLEAR :: CALL DELSPRITE(ALL) :: GOTO 100
1180 CALL LOCATE(#1,185,YPOS) :: RETURN
1190 CALL LOCATE(#1,58,YPOS) :: RETURN
1200 CALL LOCATE(#1,XPOS,10) :: RETURN
1210 REM  ** CHARACTER INIT DATA **
1220 DATA  
"000000783C1E4FE7E7FDFF03070F1E3C0000000000000181F15DF9C181000000"
1230 DATA  
"0F7840404140406221281452AC1308108080C82410884427118101030282FE00"
1240 DATA  
"31488780874023100B040100010204048C12E101E102C408F020800080402020"
1250 DATA  
"01011324081122E4888180C040417F00F01E0202820202468414284A35C81008"
1260 DATA  
"0000000001C221151521C301000000001C22418102145455555414028141221C"
1270 DATA  
"040402010001040B102340878087483120204080008020D008C402E101E1128C"
1280 DATA  
"3844828140282AAAAA2A2840818244380000000080C384A8A884438000000000"
1290 DATA  
"100813AC52142821624040414040780F00FE8202030181112744881024C88080"
1300 DATA  
"040402010001040B102340878087483120204080008020D008C402E101E1128C"
1310 DATA  
"007F4140C0808188E4221108241301010810C8354A2814844602028202021EF0"
1320 REM  ** SPRITE SPIN DATA **
1330 DATA 120,108,104,100,112,124,128,132
1340 DATA 120,108,104,100,112,124,128,132
1350 RETURN

---

From: Owen Brand <[email-masked]>
Date: Wed, 27 Jan 2010 21:55:36 -0500

By the way--- the check for "in-bounds" I am using (LINEs 910-930) may  
not require the GOSUB commands... It may be faster to just add the  
subroutine to the actual line as opposed to sending it to a  
subroutine.... I just wasn't sure if it would be faster... I suppose  

> 910 IF XPOS>185 THEN GOSUB 1180

**If this was read by the CPU as "IF XPOS>185"...... systems check,  
locate sprite, either continue with command (TRUE) or go to next  
command (FALSE).

**If this was read by the CPU as an entire command, it would have  
slightly more data to process before either:
a) continuing on to the next part of the same command to determine  
action
b) jump to next statement because XPOS is NOT larger than 185.

Yes the difference is slight, but in an arcade style game where that  
specific line is executed hundreds or thousands of times, small  
differences in speed add up.

Any thoughts?

Owen Brand
**Oprysoft**
Opry99er.com

On Jan 27, 2010, at 9:27 PM, Owen Brand <[email-masked]> wrote:

> complex COINC functions that are eating my memory.... What is here  
> is a simple game screen with 2 enemy SPRITEs with which you can  
> collide---setting off a coincidence (ALL)....  You will notice that  
> the spaces immediately before and immediately following any  
> displayed variable on the screen are that of the background and not  
> the cyan(8) sky....  I have also not yet implemented a scoring  
> engine, as that is tied in directly to the honeycomb graphics....  
> Although, I could just display a fixed point that could be reached,  
> adding to the variable "SCO" which is my score variable.  Anyway,  
> just as a little demo, paste this into Classic99 and take a  
> gander...  Hope you like the flower pattern.... :)  With a little  
> help (or not so little) from Karsten, I was able to draw the entire  
> bed using only 5 lines!!!
>
> Owen Brand
> **Oprysoft**
> Opry99er.com
>
> MAIN GAME SCREEN
>
>
> 690 CALL CHAR(33,ST$,88,FTL$,89,FT$,90,FTR$,91,FL$,92,FR$,93,FBL$, 
> 94,FB$,95,FBR$,40,FC$)
> 710 A$=CHR$(88)&CHR$(89)&CHR$(90)&CHR$(33) :: B$=CHR$(91)&CHR$(40) 
> &CHR$(92)&CHR$(33)
> 1010 CALL DELSPRITE(ALL) :: CALL SPRITE(#1,100,2,90,120) :: CALL  
> MOTION(#1,0,0) :: RESTORE 1330
> 1020 FOR DEAD=1 TO 8
> 1170 FOR X=1 TO 30 :: NEXT X :: PRINT "GAME OVER" :: CALL SCREEN 
> (L) :: NEXT L :: CALL CHARSET :: CALL CLEAR :: CALL DELSPRITE 
> (ALL) :: GOTO 100