07-16-2003, 02:56 PM
Here's my entry. Remove the delay loop if you want to see how fast it can go.
Code:
DECLARE SUB endLoading ()
DECLARE SUB updateLoadingScreen (percent%)
DECLARE SUB beginLoading ()
DEFINT A-Z
SCREEN 13
beginLoading
FOR percent = 0 TO 100
' Delay, remove to see maximum speed on your computer:
st! = TIMER: DO: t! = TIMER: LOOP UNTIL t! < st! OR t! >= st! + .01
updateLoadingScreen percent
NEXT
endLoading
END
SUB beginLoading
SHARED sectionCol, oldSection, lastPercent
sectionCol = 0
oldSection = 32767
lastPercent = -1
CLS
DRAW "bm141,90c15"
DRAW "nu6r3 br2"
DRAW "buu2ber2bfd2bgnl2br br2"
DRAW "buu2ber3d4nl3 br2"
DRAW "buu2ber3bd4nu6nl3 br2"
PSET STEP(0, -6): DRAW "bd2d4 br2"
DRAW "u4r3fd3 br2"
DRAW "buu2ber3d4nl3d2gl2hbm+4,-2 br2"
PSET STEP(0, 0), 15
PSET STEP(2, 0), 15
PSET STEP(2, 0), 15
CIRCLE (160, 100), 50, 16
CIRCLE (160, 100), 75, 16
PAINT (165, 40), 16
DRAW "bm160,100ta0c0bu35u35"
OUT 968, 14
OUT 969, 63
OUT 969, 63
OUT 969, 63
OUT 968, 32
FOR i = 0 TO 63
OUT 969, 0
OUT 969, 0
OUT 969, i
NEXT i
END SUB
SUB endLoading
FOR j = 0 TO 63 STEP 3
WAIT &H3DA, 8
OUT 968, 14
c = 63 - j
FOR i = 1 TO 6
OUT 969, c
NEXT i
OUT 968, 32
FOR i = 0 TO 63
c = i - j
IF c < 0 THEN c = 0
IF i > j THEN c = (c + i) \ 2
OUT 969, 0
OUT 969, 0
OUT 969, c
NEXT i
NEXT j
CLS
PALETTE
END SUB
SUB updateLoadingScreen (percent)
SHARED sectionCol, oldSection, lastPercent
section = -((percent * 36) \ 100) * 10
IF section <> oldSection THEN GOSUB doSection: oldSection = section
IF percent <> lastPercent THEN
lastPercent = percent
GOSUB drawPercent
END IF
c = 15 + ((SIN(percent / 4) + 1) * 24)
IF c <> loadingColor THEN
loadingColor = c
OUT 968, 15
OUT 969, c
OUT 969, c
OUT 969, c
END IF
EXIT SUB
drawPercent:
p$ = LTRIM$(STR$(percent))
l = LEN(p$) * 4
x = 156 - l \ 2: y = 110
LINE (x, y)-STEP(l + 5, -7), 0, BF
PSET (x, y), 0
DRAW "ta0c14"
FOR i = 1 TO LEN(p$)
SELECT CASE ASC(MID$(p$, i, 1))
CASE 48: DRAW "buu4erfd4gl br4"
CASE 49: DRAW "brru6ngbd6r br2"
CASE 50: DRAW "bu5erfdg3dr3 br2"
CASE 51: DRAW "bufreuhnleuhlg bf5"
CASE 52: DRAW "br2u6g2dr3 bd3br2"
CASE 53: DRAW "bufreuhlhu2r3 bd6br2"
CASE 54: DRAW "brbu3rfdglhu4erf bd5br2"
CASE 55: DRAW "bu6r3dgdgd2 br4"
CASE 56: DRAW "br2lhuenrhuerfdgfd bdbr2"
CASE 57: DRAW "brreu4hlgdfr bf3"
END SELECT
x = x + 4
NEXT i
DRAW "bue3": PSET STEP(-3, 0), 14: PSET STEP(3, 3), 14
RETURN
doSection:
IF section >= 0 THEN RETURN
DRAW "bm160,100ta" + STR$(section) + "c0bu40u24bm-2,+10"
PAINT STEP(0, 0), 32 + 5 + (sectionCol * 58) \ 35, 0
sectionCol = sectionCol + 1
RETURN
END SUB