1st is there a WAIT comand?like what is i want to print a word and then i want to wait 5 seconds? 2nd is there a RNG comand like to pick a random number?
1) there is a WAIT instructuin but it does different thing You can use user defined function Just be warned that making user wait seconds until something will happen will not add you any friends. 'busy loop delay demo read dt while dt>0 SCAN 'allow to break the loop, like closing window (!!!) print "Delay for ";dt;"ms... "; call delay dt print "Done!" read dt 'next one wend
print print "-- over --" end
'--------------------------------- sub delay ms t=time$("ms")+ms while t>time$("ms") scan 'do nothing, but allow to break the loop wend end sub
data 10 data 50 data 100 data 200 data 500 data 1000 data 3000 data -1
2) print "random number (0..1)",rnd(1) print "another random number ",rnd(1) print "now seed RND generator so each run will be same numbers" randomize .5 '0..1 print "random number (0..1)",rnd(1) print "another random number ",rnd(1) print "Try to run program several times." print "first 2 numbers will be different" print "second 2 will be the same on each run" print "5 random numbers, scaled /rounded to" print print "no scale", "0..9", "0..9 ints", "-5..4 integers" for i = 1 to 5 r=rnd(1) print r, r*10, int(r*10), -5+int(r*10) next
If you like piece of my code, go ahead and use it. I had my share of fun creating it - now it's free.
how to play sounds?like i want to add some music to my game! plus how to add some pictures(sprytes)to my game i just want to add some pop to my game! edit:how to color text and the backround when you run the game
Playwave and playmidi are the commands that play sound. For a text adventure you might just as well display bitmap images. Moving sprites can be done but it creates an animation which is harder to mesh with a text adventure.
ThankYouVar=99999 PRINT "THANK YOU,DAD!" PRINT "THANK YOU MENU:" PRINT "1.THANK YOU!" PRINT "2.COOL MUSIC" PRINT "3.SLIME PUP EMOJIS(no work)" PRINT "4.NUCLEAR THANK YOU" DO INPUT "choose a thank you: "; choice SELECT CASE choice CASE 1 GOSUB 300 CASE 2 GOSUB 310 CASE 3 GOSUB 320 CASE 4 GOSUB 330 CASE 0 END CASE ELSE PRINT "Invalid thank you,please choose the thank you." END SELECT LOOP UNTIL TRUE END 300 REM Entry for Azure PRINT "thanks to you:" PRINT "i know how to code!" PRINT "this is the first demo contaning sound and music btw" PRINT "so comeon sheck out option 2 and 3!" RETURN 310 REM PRINT "1.Slumber Party" PRINT "2. Jams" PRINT "3.Jams VIP" PRINT "4.No More Entities" PRINT "5.Updated N Upraded" PRINT "6.Transit" PRINT "7.Who's hungry?" DO INPUT "choose music: "; choice SELECT CASE choice CASE 1 GOSUB 100 CASE 2 GOSUB 110 CASE 3 GOSUB 120 CASE 4 GOSUB 130 CASE 5 GOSUB 140 CASE 6 GOSUB 150 CASE 7 GOSUB 160 CASE 0 CASE ELSE PRINT "Invalid music you,please choose the music." END SELECT LOOP UNTIL TRUE 100 REM PRINT "PLAYING MUSIC" PLAYWAVE "C:\Users\Anton\Downloads\compressed\Fishcracks - Slumber Party (Kaiju Paradise OST) (256 kbps) (1).wav" PRINT "STOPING MUSIC" RETURN 110 REM PRINT "PLAYING MUSIC" PLAYWAVE "C:\Users\Anton\Downloads\compressed\Fishcracks - JAMS (Kaiju Paradise OST) (256 kbps).wav" PRINT "STOPING MUSIC" RETURN 120 REM PRINT "PLAYING MUSIC" PLAYWAVE "C:\Users\Anton\Downloads\compressed\Fishcracks - JAMS (VIP) (Kaiju Paradise OST) (256 kbps).wav" PRINT "STOPING MUSIC" RETURN 130 REM PRINT "PLAYING MUSIC" PLAYWAVE "C:\Users\Anton\Downloads\compressed\Fishcracks - Updated N Upgraded (Kaiju Paradise OST) (256 kbps).wav" PRINT "STOPING MUSIC" RETURN 140 REM PRINT "PLAYING MUSIC" PLAYWAVE "C:\Users\Anton\Downloads\compressed\Fishcracks - Transit (Kaiju Paradise OST) (256 kbps) (1).wav" PRINT "STOPING MUSIC" RETURN 150 REM PRINT "PLAYING MUSIC" PLAYWAVE "C:\Users\Anton\Downloads\compressed\Fishcracks - Whos Hungry_ (Kaiju Paradise OST) (256 kbps) (1).wav" PRINT "STOPING MUSIC" RETURN 330 REM PRINT "1.YEZ!" PRINT "2.no" INPUT "are you sure??this could destroy your PC!: "; choice SELECT CASE choice CASE 1 GOSUB 200 CASE 2 GOSUB 210 CASE ELSE PRINT "bro i think you missed the point." END SELECT end 200 REM DO PRINT "THANK YOU,DAD!" LOOP UNTIL TRUE RETURN 210 REM end 320 REM LOADBMP "bg", "bg.bmp" RETURN
The question "how to display a bitmap images??" has no right and easy answer
Basically, to show picture, you need a window some easy way would be LOADBMP LOADBMP "bg", "bg.bmp" open "your_title" for graphics_nsb_nf as #gr #gr "down" #gr "drawbmp bmp 0 0" #gr "flush" 'so your picture will not desappear if you move over window above it
but this is not quite right * Window needs to be closed, so it needs trapclose command (or program will complain on close about window #gr) * default graphics_nsb_nf is somewhat 320x370 pixels. If you know your bitmap size, you should set WindowWidth WindowHeight before opening window. If you do not know beforehand, there is code that read size from bitmap file * This method does not scale bitmap. If it is too big, you will see only top left corner
See? No "right and easy". All could be taken care of, but it going to get complicated...
(btw, there is 2 more ways to show bitmap 1) Using sprite engine (read Help on Sprites) and set loaded bitmap as background. This way picture will be scaled up 2) Using BMPBUTTON With some tricks it could be scaled any way, up or down Have a look here justbasiccom.proboards.com/thread/1042/using-bmpbutton-scale-bitmaps
EDIT there is 0-option Just let Windows handle all this run "explorer.exe ";"bg.bmp" But for me it opens bitmap in Paint - not exactly thing I would like then I want to *show* bitmap