[X68000] The Bermuda Rectanguler Area

X68000, プログラム, BASIC

There isn’t a single user-submitted X68000 game. You can’t just keep playing GRADIUS (a.k.a LIFE FORCE) all the time. SPACE HARRIER is fine, though…

TOC

Description

Use the BOMB to sink your nemesis, the Black Submarine!
When you RUN the program, the LEVEL will be displayed. Please start with Level 1.。

A blue sea will appear—move the arrow cursor and launch your BOMB.
A white ring will expand outward; if it touches the enemy, it stops right there and turns red. If it doesn’t touch the enemy, it remains a blue ring.
Fully mouse-compatible. It’s a game where deduction and intuition are key!
Also, when you finish, there’s a Star Luster-style rank display (how beautifully simple!).)。

Program

I don’t really want to use overly specialized commands—it makes porting a pain. So, I made this with ease of porting in mind!

Note that Table 1 outlines key points to keep in mind when porting.

<Table 1> Points to Keep in Mind When Porting
100 REPEAT     100 REM
110 UNTIL A<0  110 if NOT(A<0)THEN GOTO 100

100 WHILE1     100 REM
110 ENDWHILE   110 GOTO 100

Changing mouse-related commands to key inputs
MSSTAT (X,Y,left button,right button)
MSPOS (X,Y)

100 SUB<>      100 GOSUB 120
110 END        110 END
120 FUNCSUB<>  120 REM
130 PRINT"SUB" 130 PRINT"SUB"
140 ENDFUNC    140 RETURN

Others

You can maximize all the features the X68K has to offer—like its 65,000-color graphics, scrolling, and sprites—but then it wouldn’t be portable to other systems. We’ll leave that kind of thing for another time…

PS1: Girls often come to the nearby Sega-operated Hi-Tech arcade (though they usually have a boyfriend right next to them). Sega’s future is bright, isn’t it?!
PS2: Thank you all for your continued support. This is Matsushima from the R&D department. Now that Space Harrier is finished and I had some free time, I decided to make a program for BASIC Magazine.

Source Code (X-BASIC)

1000 screen 0,2,1,1
1010 BETSPRITE()
1020 SETSOUNDC()
1030 /*
1040 dim int TX(15),TY(15),TH(15) TF(15)
1050 int MX,MY,BL,BR
1060 int LEVEL,RANK,RR
1070 int BCOUNT,MAXBOMB
1080 int ECOUNT,MAXSENEMY
1090 float XE,YE,VE
1100 float BX,BY,BV
1110 /************
1120 dim str RANK$(10)
1130 RANK$(0)="CADET BUG.."
1140 RANK$(1)="EDITOR KAGE"
1150 RANK$(2)="EDITOR HEN"
1160 RANK$(3)="GAMER Yu-You"
1170 RANK$(4)="GAMER AKIRA"
1180 RANK$(5)="GAMER ICHIRO"
1190 RANK$(6)="EXCHANGER"
1200 RANK$(7)="CAPTAIN HAERLOC"
1210 RANK$(8)="CAPTAIN OKITA"
1220 RANK$(9)="ESP DREAM"
1230 RANK$(10)="ESP HARRIER!"
1240 /************************
1250 /* MAIN LOOP
1260 /************************
1270   while 1
1280     MENU()
1290     SETENEMY()
1300     PLAY()
1310     ENDING()
1320   endwhlie
1330 /*
1340 end
1350 /*****************************
1360 func PLAY()
1370 /*****************************
1380 ECOUNT=MAXENEMY+1
1390 BCOUNT=MAXBOMB+1
1400 PUTDATA()
1410  repeat
1420    msstat(MX,MY,MBL,BR)
1430    mspos(MX,MY)
1440 /*
1450  if BL<>0 or BR<>0 then {
1460    mouse(2):BOMB()
1670    MOUSE(1):MOUSE(4)
1480    PUTDATA()}
1490 /*
1500  until ECOUNT=0 or BCOUNT=0
1510 endfunc
1520 /*****************************
1530 func BOMB()
1540 /*****************************
1550 BCOUNT=BCOUNT-1
1560 FIND=0
1570 /*
1580 XE=(MX-240)/100#:BX=240-8
1590 XE=(MY-240)/100#:BY=224-8
1600 VE=5#:BV=0#
1610 m_play(8)
1620 /*
1630 for I=0 to 100
1640  sp_move(0,BX,BY   ,2)
1650  sp_move(1,BX,BY-BV,2)
1660   BX=BX+XE
1670   BY=BY+YE
1680  VE=VE-O,BV=BV+VE
1690 next
1700 m_play(6):sp_off (0,1)
1710 /*******************
1720 /* Did it hit?
1730 /*******************
1740   for I=0 to MAXENEMY
1750    TR(I)=sqr(pow(MX-TX(I),2)+pow(MY-TY'I(,2)+1)
1760    if TR(I)<6 and TF(I)=1 then CRUSH()
1770   next
1780 /*
1790 apage(1):RR=6
1800 /******************
1810 /* Search the perimeter!!
1820 /******************
1830 repeat:RR=RR+1
1840 circle(MX,MY,RR,255) :/* Draw waves
1850 /*
1860    for I=0 to MAXENEMY
1870    if abs(TR(I)-RR)<2 and TF(I)=1 then FIND=1
1880    next
1890 /*
1900 circle(MX,MY,RR,135) :/* Erase waves
1910 until FIND<>0 or RR>31
1920 /******************************
1930 apage(0)
1940 if FIND=0 then circle(MX,MY,RR,31):m_play(3)
1950 if FIND=1 then circle(MX,MY,RR,48):m_play(4)
1960 endfunc
1970 /******************************
1980 /* func CRUSH()
1990 /******************************
2000 TF(I)=0
2010 ECOUNT=ECOUNT-1
2020 sp_move(4+I,TX(I)-8,TY(I)-8,3)
2030 m_play(7)
2040 endfunc
2050 /******************************
2060 /* func PUTDATA()
2070 /******************************
2080 locate 27,5:print BCOUNT
2090 locate 27,8:print ECOUNT
2100 endfunc
2110 /******************************
2120 /* func ENDING()
2130 /******************************
2140 mouse(0):mouse(4)
2150 for T=0 to 7000:next
2160 if ECOUNT=0 then YOUWIN()
2170 if ECOUNT>0 then ENEMYWIN()
2180 /*
2190  RANK=int((BCOUNT+LEVEL+1)*0.8#)
2200  if ECOUNT>0 then RANK=0
2210  if RANK>10  then RANK=10
2220  locate 3,7:print"YOUR RANK "
2230  locate 3,8:print RANK;"P  ";RANK$(RANK)
2240 /*
2250 locate 4,10:print"PUSH BUTTON TO REPLAY"
2260 sp_off(0,19):vpage(0)
2270 /*
2280  repeat
2290  msstat(MX,MY,BL,BR)
2300  until BL<>0 or BR <>0
2310 /*
2320  repeat
2330  msstat(MX,MY,BL,BR)
2340  until BL=0 and BR=0
2350 endfunc
2360 /******************************
2370 /* func ENEMYWIN()
2380 /******************************
2390 for J=0 to 20
2400 for I=0 to MAXENEMY
2410   if TF(I)<>0 then {
2420    sp_move(4+I,TX(I)-9,TY(I)-8,4)
2430    if (J and I)=1 then sp_off(4+I)
2440    if (J and I)=0 then sp_on(4+I)
2450   }
2460    for T=0 to 100:next
2470 next
2480 next
2490 m_play(5)
2500 locate 4,5:print"LOST ALL BOMBS"
2510 endfunc
2520 /******************************
2530 /* func YOUWIN()
2540 /******************************
2550 m_play(4)
2560 locate 8,5:print"YOU WIN !"
2570 endfunc
2580 /******************************
2590 /* func MENU()
2600 /******************************
2610 cls
2620 mouse(1):mouse(4)
2630 locate 3,2:print"Submarine 606.
2640 locate 3,5:print"  The Bermuda Rectangular Area
2650 locate 2,5:print"LEVEL 1 2 3 4 5"
2660 msarea(60,80,139,96)
2670 /*
1680 repeat
1690  msstat(MX,MY,BL,BR)
1700  mspos(MX,MY)
1710  rnd()
2720 until BL<>0 or BR<>0
2730 /*
2740 LEVEL=(MX-60)/16+1
2750 MAXBOMB =LEVEL*2+22
2760 MAXENEMY=LEVEL*1+5
2770 m_play(1,2)
2780 endfunc
2790 /******************************
2800 /* func SETENEMY()
2810 /******************************
2820 for I=0 to MAXENEMY
2830   sp_off(4,I)
2840   FLG =0
2850   TX(I)=int(rnd()+160+32)
2860   TY(I)=int(rnd()+160+64)
2870 /*
2880 if I>0 then {
2890  for J=0 to I-1
2900    RR=srq(pow(TX(J)-TX(I),2)+pow(TY(J)-TY(I),2))
2910    if RR<8 then FLG=1
2020  next}
2930 /*
2940   TF(I)=1:if FLG=1 then I=I-1
2950 next
2960 /***************
2970 /* Draw the screen!
2980 /***************
2990 apoge(0):wipe()

Let's share this post !

Comments

To comment

TOC