Here's a basic example...
`set up screen
set display mode 640,480,32
hide mouse
sync on
Gosub bar_image : `image 1
`Load Program
load_bar("Loading Images...",1)
gosub load_images
load_bar("Loading Sounds...",33)
gosub load_sounds
load_bar("Loading Objects...",66)
gosub load_objects
load_bar("Starting Game...",100)
wait 2000
END
`------------
` Functions
`------------
Function load_bar(tag$,percent)
cls
center text 320,215,tag$
sprite 1,220,235,1
stretch sprite 1,200*percent,100 : `stretches the image to a % of original size
sync
Endfunction
`--------------
` Subroutines
`--------------
bar_image:
`draw bar 1 pixel wide (we can stretch it out to any size)
ink rgb(0,255,0),0 : `base colour
line 0,0,0,8
ink rgb(0,191,0),0 : `shade level 1
dot 0,7
ink rgb(0,128,0),0 : `shade level 2
dot 0,8
ink rgb(255,255,255),0 : `shine
dot 0,1
`grab the image
get image 1,0,0,1,9
RETURN
`//
load_images:
wait 2000
RETURN
`//
load_sounds:
wait 2000
RETURN
`//
load_objects:
wait 2000
RETURN
`//
If you want to show the user what's being loaded you have to interrupt the program to do it, so keeping to a vague idea like I have is best or else you'll slow the computer down.
As for giving an accurate percentage, you could use FILE SIZE() to check the size of all the files your where going to load beforehand and then count them off as you loaded. Seems like a lot of work for little return though.
I'll throw in my statistic bar tutorial too...
REMSTART
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
How To Make Stastic Bars
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Statistic bars require 3 variables: minimum value, maximum value and current value.
Statistic bars do not require the use of an image (a simple box is fine) but for this example we will use one.
REMEND
`* Making the Stat Bar Image *
remstart
There are two methods of using stastic bar images: Cutting and Stretching.
_CUTTING
If we want a fancy bar that looks different all along its length we will have to draw the entire bar and then
cut the right percentage from the image to be displayed in the game.
_STRETCHING
If our bar looks the same along the entirety of its length, we only need to make 1% of the bar and then
stretch it to the right percentage.
For this example we will use a stretching bar.
remend
`draw 1% image
ink rgb(0,255,0),0 : `base colour
line 0,0,0,8
ink rgb(0,191,0),0 : `shade level 1
dot 0,7
ink rgb(0,128,0),0 : `shade level 2
dot 0,8
ink rgb(255,255,255),0 : `shine
dot 0,1
`grab the image
get image 1,0,0,1,9
cls 128
`draw a frame for our bar
line 200,190,200,200
line 300,190,300,200
set text size 7
center text 200,180,"0%"
center text 300,180,"100%"
sprite 1,201,201,1
sync on
rem 100% on the bar is 10000% of the images original length
rem in a game x would be replaced by the statistic variable
for x = 0 to 100
stretch sprite 1,100*x,100
sync
next x
end
A small program that works is better than a large one that doesn't.

DBC Challenge Rank:
Rookie