Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help plz in qbasic... in the shell command

Dparish14Dparish14 Member Posts: 2
[b][red]This message was edited by Dparish14 at 2006-6-15 13:45:53[/red][/b][hr]
me and my freind are making this game in c++ and java. the music is in a sepsrate file to the game and we want to make a qbasic program to load them both up and hav the music playing in the background and hav the game on screen.. we hav made this so far
cls
SHELL "c:gameplay.EXE" "C:gamesound.EXE"



Comments

  • IDKIDK Member Posts: 1,784
    : [b][red]This message was edited by Dparish14 at 2006-6-15 13:45:53[/red][/b][hr]
    : me and my freind are making this game in c++ and java. the music is in a sepsrate file to the game and we want to make a qbasic program to load them both up and hav the music playing in the background and hav the game on screen.. we hav made this so far
    : cls
    : SHELL "c:gameplay.EXE" "C:gamesound.EXE"
    :
    :
    :
    :
    Since qbasic can't handle threads it isn't possible to start two programs at once.

    Use some other language that supports threading.
  • casio-games.tkcasio-games.tk Member Posts: 35
    : : [b][red]This message was edited by Dparish14 at 2006-6-15 13:45:53[/red][/b][hr]
    : : me and my freind are making this game in c++ and java. the music is in a sepsrate file to the game and we want to make a qbasic program to load them both up and hav the music playing in the background and hav the game on screen.. we hav made this so far
    : : cls
    : : SHELL "c:gameplay.EXE" "C:gamesound.EXE"
    : :
    : :
    : :
    : :
    : Since qbasic can't handle threads it isn't possible to start two programs at once.
    :
    : Use some other language that supports threading.
    :

    Its possible to use the PLAY command, if beep sounds are OK.

    [code]PLAY "MB"
    PLAY "C E G"
    [/code]
    "MB" makes qb play the sound in the background, so the game is not being breaked.

    [code]SOUND 100,0[/code] to delete the sound in the queue before PLAYing new sound.

    some code i used in a boring game: (im not sure it works cos i deleted most of it)

    [code]
    ' Music
    muson = 1
    wantmus = 1
    mus = 1
    GOSUB music

    start = TIMER
    playat = start

    '-----------------------Start
    DO

    IF PLAY(0) = 0 THEN GOSUB music '-- PLAY(0) is the number of notes in the queue--

    keyn = INP(96) ' keyboard input

    IF keyn = 1 THEN SOUND 100, 0: END 'To make the speaker shut up, and exit :-D
    IF keyn = 50 THEN wantmus = -muson' turn on/off music

    IF playerwonthegameevent THEN

    PRINT "You came out alive!"

    SOUND 100, 0: PLAY "l4 o2 c e g o3 l2 c"

    SLEEP
    END
    END IF

    SELECT CASE pxl

    CASE 14: SOUND 100, 0: PLAY "mb l32 c e g": score = score + 1

    END SELECT

    IF thegameisoverevent THEN
    PRINT "You died!"

    SOUND 100, 0: SOUND 50, 30

    SLEEP
    END
    END IF


    t = TIMER
    IF t - playat > 1 THEN playat = t: 'SOUND 1000, .5 ' CLICK-SOUND every second instead of PLAY

    DO
    key$ = INKEY$
    LOOP WHILE t + .01 > TIMER


    LOOP


    music:
    muson = wantmus

    IF muson = 1 THEN
    SELECT CASE mus
    CASE 1: PLAY "MB O3 L2 A L4 F C D F F C"
    CASE 2: PLAY "L4 D F F > C < L2 A G"
    CASE 3: PLAY "L2 A L4 F C D F F C"
    CASE 4: PLAY "L4 D F L8 A# A L4 G L2 F P2"
    END SELECT

    END IF

    mus = mus + 1
    IF mus = 5 THEN mus = 1
    RETURN

    [/code]
    [hr][hr]
    Don't write pH, write Ph!



Sign In or Register to comment.