
-----------------------------------
Brad71
Thu Mar 24, 2005 5:46 pm

need help with adding a sound clip
-----------------------------------
I got bored with the bouncing ball program so me and my friend wanted to alter it slightly. Mr. T's head bounces around instead of a ball and I want it to play a sound clip when he hits the edge. I figured that part out but don't know how to stop the sound from looping. here's the code, any suggestions.


var picID : int
picID := Pic.FileNew ("mr-t-head.bmp")
var x, y, dirx, diry : int
x := maxx div 2
y := maxy div 2
dirx := 1
diry := 1
process pity
    loop
        Music.PlayFile ("pitydafool.wav")
    end loop
end pity
loop
    x += dirx
    y += diry
    if x < 0 or x > maxx - 53 then
        dirx := dirx * -1
        fork pity
    end if
    if y < 0 or y > maxy - 85 then
        diry := diry * -1
        fork pity
    end if
    Pic.Draw (picID, x, y, picCopy)
    View.Update
    delay (10)
    cls
end loop


-----------------------------------
Token
Thu Mar 24, 2005 6:35 pm


-----------------------------------
just remove the loop from the process

-----------------------------------
Brad71
Thu Mar 24, 2005 6:43 pm


-----------------------------------
Thanks

-----------------------------------
Token
Thu Mar 24, 2005 9:25 pm


-----------------------------------
your welcome, its actually a pretty good idea for a program, you should draw multiple mr-t's and have them bounce into each other.
