Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 music on each page
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
air_force91




PostPosted: Wed Jan 14, 2004 5:19 pm   Post subject: music on each page

im sorry im asking u ppl a lot of ques...i just wanna get as much info on turing as possible...my project is due tomorrow and my partner's not even helping me out! the problem now is that ive added a music file into my title page but i want it to end as soon as the user enters a key to get to a new page...

code:
var winID : int
        winID := Window.Open ("position:800;350,graphics:800;350")
       
  View.Set ("nocursor")
       


colourback (red)
cls

%music

process DoMusic
    loop
        Music.PlayFile ("piccccc.wav")
    end loop
end DoMusic
fork DoMusic

%Import computer picture
var comppic : int := Pic.FileNew ("computerback.bmp")
Pic.Draw (comppic, maxx div 2 - (Pic.Width (comppic) div 2), maxy div 2 - Pic.Height (comppic) div 2, picMerge)
var fontID : int := Font.New ("Franklin Gothic Medium:16:bold")
Font.Draw ("Welcome To", 300, 300, fontID, green)
Font.Draw ("...", 350, 275, fontID, yellow)

%3D effect for "The Ultimate MB!!"

var size : int := 40
var text : string
var text1 := "The Ultimate MB!!"
var ch : string (1)

var afontID : array 1 .. size of int

for i : size div 2 .. size
    afontID (i) := Font.New ("Tahoma:" + intstr (i))
end for


procedure Text3D (text : string)
    for t : 1 .. length (text)
        for i : size div 2 .. size
            Font.Draw (text (t), t * size, 170, afontID (i), 20 + floor
                (i / size * 15))
        end for
    end for
end Text3D

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% You have to insert the picture before the text, so that                   %
%  the text will overlap the picture                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Text3D (text1)

%ball animation

%"enter any key"
var bfontID : int := Font.New ("Arial:10:bold")
Font.Draw ("Press any key to continue...", 597, 25, bfontID, blue)
getch (ch)

cls

%%%%%%%%%%%%%%%%%%%%%%%%%%%%second page%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

colourback (3)
cls


var sizea : int
var text2 : string
sizea := 15
var text3 := "The Ultimate MB!!"

var cfontID : array 1 .. sizea of int

for i : sizea div 2 .. sizea
    cfontID (i) := Font.New ("Tahoma:" + intstr (i))

end for

procedure Text3D1 (text2 : string)


    for t : 1 .. length (text2)

        for i : sizea div 2 .. sizea
            Font.Draw (text2 (t), t * sizea, 315, cfontID (i), 20 + floor
                (i / size * 50))

        end for
    end for


end Text3D1
Text3D1 (text3)

%%Import computer picture

var comppic1 : int := Pic.FileNew ("file4.bmp")
Pic.Draw (comppic1, 90 div 2 , 40 div 2, picMerge)


%%%%%%%%%%%%%%%%%%%%%%buttons

%3rd button

Draw.FillBox (550, 40, 667, 90, 5)
Draw.Box (550, 40, 667, 90, 1)

var dfontID : int := Font.New ("Arial:12:bold")
Font.Draw ("Exit", 590, 60, dfontID, black)

%2nd button

Draw.FillBox (550, 140, 667, 190, 5)
Draw.Box (550, 140, 667, 190, 1)

var efontID : int := Font.New ("Arial:12:bold")
Font.Draw ("Start Game", 562, 160, efontID, black)

%1st button

Draw.FillBox (550, 240, 667, 290, 5)
Draw.Box (550, 240, 667, 290, 1)

var ffontID : int := Font.New ("Arial:12:bold")
Font.Draw ("Instructions", 562, 260, ffontID, black)

%%%mouse detect--*click*

loop

    var x, y, btn : int
    Mouse.Where (x, y, btn)

    if x >= 550 and x <= 667 and y >= 240 and y <= 290 and btn = 1 then
        cls
        colourback (blue)
        cls

        %%%%%%%%%%%%%%%%%instructions page%%%%%%%%%%%%%%%%%%%%%%%%%%%
        var ifontID : int :=Font.New ("Arial Narrow:10:bold")
       
        var gfontID : int := Font.New ("Tahoma:15:bold")

        var hfontID : int := Font.New ("Arial:12:bold")
       
      Font.Draw ("Click on screen to go back to main screen...", 530, 25, ifontID, yellow) 

        Font.Draw ("Instructions!!", 5, 325, gfontID, yellow)

        delay (800)

        Font.Draw ("1) After clicking 'Start Game', you are led to a screen with an empty motherboard and several ", 50, 260, hfontID, yellow)
        Font.Draw ("motherboard parts on the side.", 67, 240, hfontID, yellow)

        delay (800)

        Font.Draw ("2) The object of the game is to drag and place the parts in their correct place on the ", 50, 180, hfontID, yellow)
        Font.Draw ("motherboard.", 67, 160, hfontID, yellow)

        delay (800)

        Font.Draw ("3) For each correct placement, you receive one point and LEDs perform an effect on the", 50, 100, hfontID, yellow)
        Font.Draw ("posterboard included. If placement is incorrect, part next to lighted LED illustrates", 67, 80, hfontID, yellow)
        Font.Draw ("correct placement.", 67, 60, hfontID, yellow)

        delay (100)

        Font.Draw ("Good Luck!", 340, 35, hfontID, yellow)
       

    elsif x >= 550 and x <= 667 and y >= 140 and y <= 190 and btn = 1 then

        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%Start Game Page%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 

   elsif x >= 550 and x <= 667 and y >= 40 and y <= 90 and btn = 1 then

        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%EXIT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     cls
     colourback (6)
     cls
       
         var ifontID : int :=Font.New ("Comic Sans MS:12:bold")
     
        Font.Draw ("Thank you for Playing...", 16, 327, ifontID, green)
       
        delay (10000)
       
        Window.Close (winID)
       Window.Hide (winID)



    end if


end loop



thank u sooooooooooo much!
Sponsor
Sponsor
Sponsor
sponsor
CjGaughan




PostPosted: Wed Jan 14, 2004 5:41 pm   Post subject: (No subject)

Music.SoundOff might do the trick..not positive on that one though.


or a better one could be

Music.PlayFileStop
the_short1




PostPosted: Sat Jan 17, 2004 5:34 pm   Post subject: (No subject)

Dam that weird.. i posted use Music.PlayFileStop last night but all my posts last night aren't here this morning so i have to re-post....
shorthair




PostPosted: Sat Jan 17, 2004 6:20 pm   Post subject: (No subject)

use shorts idea , its gonna look like this

IE

code:

var ans
process Music
Music.PlayFile
end Music
fork music
put " Ans:"
get ans
if ans = hello
then
Music.Stop ** not sure what hte stop comand is ** its in help
else
put" and the beat goes on "
end if
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: