home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 32
/
hot34.iso
/
ficheros
/
VDUKE
/
HELP1O1.ZIP
/
HELPER2.BAS
< prev
next >
Wrap
BASIC Source File
|
1997-06-24
|
7KB
|
244 lines
' This is the source code for MapBuddy. PLEASE run this file if you can
'instead of the EXE because this has some really cool FX :)
'The compiler I have sucks hard and it just doesn't want to handle
'all the math I guess.
'Some of the Subroutines in here I didn't make, I just modified and used.
'Thanx to PHOBIA for the cool letter burning thing, The WARP effect
'I forgot where I found but Thanx to whoever put that on the 'Net too!
'This is freeware but please if you're going to upload it, upload the
'origional ZIP file will ya? I REALLY dont want to download someone else's
'revisions plus this program.
'
'On a lighter note, If you have any handy revisions or SUBS you think
'I should add or and BUGS I should look into, PLEASE feel free to E-MAIL
'me at the following address: CoolMrGeoff@Juno.com
'You should go to Juno.com, they'll give ya a free email address AND
'It comes with a nifty JUNO dialer and browser, complete with spell check!
DECLARE SUB newcl () 'This sets up the SUBS
DECLARE SUB BurnPrint (y%, X%, text$, iter%) '<-- Cool BURNPRINT routine!
DECLARE SUB PAL () '<-- Custom PALETTE for
' BURNPRINT
DEFINT A-Z:
' Title Screen
SCREEN 13:
CALL PAL
CALL BurnPrint(11, 9, "MapBuddy Build Utility", 16)
' End of Title Screen
' Blue fade in all and half out.
2 CLS
DEFINT A-Z: SCREEN 12: CLS
red = 0
blue = 0
green = 0
FOR blue = 1 TO 63
BACKCOLOR& = 65536 * blue + 256 * green + red
PALETTE 0, BACKCOLOR&
FOR w = 1 TO 10000: NEXT w
NEXT blue
FOR blue = 63 TO 32 STEP -1
BACKCOLOR& = 65536 * blue + 256 * green + red
PALETTE 0, BACKCOLOR&
FOR w = 1 TO 10000: NEXT w
NEXT blue
'End of Blue fade effect
'Start of the Menu code...
DIM Sine%(360), Cosine%(360)
DIM StarAngle%(100), StarDistance%(100)
DIM OldStarX%(100), OldStarY%(100)
DIM StarTransX%(100), StarTransY%(100)
DIM StarSpeed%(100)
NumStars% = 100
FOR N% = 0 TO 360
Sine%(N%) = SIN(N% / 57.2958) * 10
Cosine%(N%) = COS(N% / 57.2958) * 10
NEXT N%
FOR N% = 1 TO NumStars%
StarAngle%(N%) = INT((360 - 1 + 1) * RND + 1)
StarDistance%(N%) = INT((1000 - 1 + 1) * RND + 1)
StarSpeed%(N%) = INT((100 - 1 + 1) * RND + 1)
NEXT N%
SCREEN 12
WINDOW (-10000, -10000)-(10000, 10000)
DO
LOCATE 8, 21
PRINT "MapBuddy Map Building Utility Version 1.1"
LOCATE 10, 26
PRINT "Programmed by: Geoff Traugott"
LOCATE 13, 27
IF mapname$ = "" THEN 244
PRINT "1. Start Building "; mapname$
245 LOCATE 14, 27
PRINT "2. Change Map Name to Edit (Do FIRST!!!)"
LOCATE 15, 27
PRINT "3. Instructions and Info."
LOCATE 16, 27
PRINT "4. Exit to DOS"
LOCATE 18, 20
FOR N% = 1 TO NumStars%
StarDistance%(N%) = (StarDistance%(N%) + StarSpeed%(N%)) MOD 1000
StarTransX%(N%) = (Cosine%(StarAngle%(N%))) - (Sine%(StarAngle%(N%))) * StarDistance%(N%)
StarTransY%(N%) = (Sine%(StarAngle%(N%))) + (Cosine%(StarAngle%(N%))) * StarDistance%(N%)
NEXT N%
FOR N% = 1 TO NumStars%
PSET (OldStarX%(N%), OldStarY%(N%)), 0
PSET (StarTransX%(N%), StarTransY%(N%)), StarDistance%(N%) \ 68 + 17
OldStarX%(N%) = StarTransX%(N%)
OldStarY%(N%) = StarTransY%(N%)
NEXT N%
key$ = INKEY$
FOR grets = 1 TO 10000: NEXT grets
LOOP UNTIL key$ <> ""
IF key$ = "1" THEN 12
IF key$ = "2" THEN 13
IF key$ = "3" THEN 14
IF key$ = "4" THEN 231
GOTO 2
' The PICK YOUR MAP screen
14 SCREEN 0
LOCATE 1, 1
SHELL "Type info.dat|more"
INPUT "-Press enter when done-", inou$
GOTO 2
13 CLS
PRINT "What is the name of the .map file you will be building?"
PRINT "It is VERY important that you type this correctly,"
PRINT "because if it is wrong it wont run OR build the correct map!"
PRINT "If you were building SAMPLE.MAP you would enter SAMPLE as the"
PRINT "name."
PRINT
532 INPUT "What is the map name WITHOUT the extention :", mapnam$
mapname$ = mapnam$ + ".map"
PRINT "You are building "; mapname$; " .. Correct? (Y,N)"
INPUT cor$
IF cor$ = "n" THEN GOTO 532
IF cor$ = "N" THEN 532
GOTO 2
12 REM
'
'
'
'Main Code
FOR blue = 32 TO 0 STEP -1
BACKCOLOR& = 65536 * blue + 256 * green + red
PALETTE 0, BACKCOLOR&
FOR w = 1 TO 10000: NEXT w
NEXT blue
SCREEN 0
3 PRINT "Building "; mapname$
shellstringone$ = "Build " + mapname$
SHELL shellstringone$
PRINT "1. Test Map"
PRINT "2. Quit"
INPUT R
IF R = 2 THEN GOTO 2
shellstringtwo$ = "Duke3d -map " + mapname$
SHELL shellstringtwo$
PRINT "1. Build Map"
PRINT "2. Quit"
INPUT R
IF R = 2 THEN GOTO 2
GOTO 3
231 FOR blue = 32 TO 0 STEP -1
BACKCOLOR& = 65536 * blue + 256 * green + red
PALETTE 0, BACKCOLOR&
FOR w = 1 TO 10000: NEXT w
NEXT blue
newcl
END
244 PRINT "--==** No map selected **==--"
GOTO 245
SUB BurnPrint (y%, X%, text$, iter%)
' Sin Table
DIM sn(360)
FOR R = 0 TO 360
sn(R) = SIN(R)
NEXT
' PRINT THE TEXT
COLOR 48: LOCATE y%, X%
PRINT text$
' WAIT KEYPRESS
DO: LOOP WHILE INKEY$ = ""
' CALCULATE TEXT POSITION
lenght = LEN(text$)
xstart = (X * 8) - 8
xend = ((X + lenght) * 8) - 8
ystart = (y * 8) - 16
yend = (y * 8) - 8
FOR R = 1 TO iter%
FOR y = ystart TO yend + 8
FOR X = xstart TO xend
col = FIX(POINT(X + sn(a), y) + POINT(X, y + 1)) / 2 - (3 * RND)
IF col < 0 THEN col = 0
PSET (X, y), col
a = a + 1: IF a = 360 THEN a = 0
NEXT X
NEXT y
NEXT R
END SUB
SUB newcl
DIM ScreenPos%(2000)
FOR X% = 1 TO 2000
ScreenPos%(X%) = X%
NEXT X%
FOR X% = 1 TO 2000
SWAP ScreenPos%(X%), ScreenPos%(INT(RND(1) * 2000) + 1)
NEXT X%
FOR X% = 1 TO 2000
R% = ScreenPos%(X%) \ 80 + 1
IF R% = 0 THEN R% = 1
IF R% > 25 THEN R% = 25
C% = ABS(ScreenPos%(X%) - (80 * R%))
IF C% = 0 THEN C% = 1
LOCATE R%, C%
PRINT " ";
NEXT X%
LOCATE 1, 80: PRINT " "; ' cheap temporary fix
END SUB
SUB PAL
' MADE BY PHOBIA
' setup palette (Made By PHOBIA)
FOR Ac% = 0 TO 63
OUT &H3C7, Ac% / 4
OUT &H3C9, Ac%
OUT &H3C9, 0
OUT &H3C9, 0
OUT &H3C7, Ac% / 4 + 16
OUT &H3C9, 63
OUT &H3C9, Ac%
OUT &H3C9, 0
OUT &H3C7, Ac% / 4 + 32
OUT &H3C9, 63
OUT &H3C9, 63
OUT &H3C9, Ac%
NEXT
END SUB