hi,
I am having problems on how to insert mp3s. I am a total beginner. but i looked in the manuals, searched the blitz site, looked at examples. but strangly. nothing?????
i want to know how i can load and play a mp3. thank you
============================================================
; LoadImage and DrawImage example
; Declares the GLOBAL variable which will be used throughout the program
Global player ; the player variable
Global snd ; sound variable
Global introPic ; intropic
Global x = 300 ; x coordinates of the player
Global y = 250 ; y coordinates of player
; Set a graphics mode
Graphics 800,600,16
; Set drawing operations for double buffering
SetBuffer BackBuffer()
; Load the image and assign its file handle to the variable
; - This assumes you have a graphic called player.bmp in the
; same folder as this source code
player=LoadImage("player.bmp") ; loads an image
snd = LoadSound ("amok.mp3") ; loads a sound file
intropic = LoadImage ("intro.jpg");
timer = CreateTimer(20)
DrawImage introPic, 1,1 ; draws intro pic
Flip ; flips it from back buffer
While Not KeyDown (57) ; waits for space bar to be pressed
Wend
;Starts a loop - this is the heart of the program
While Not KeyHit(1) ; this is saying : repeat until ESC key is hit. 1 is the scan code for the ESC key
Cls ; clear the screen
; moving the player around the screen
If KeyDown (200) y=y-2 ; if up arrow key is pressed, move ship up by decreasing the y value by 2
If KeyDown (203) x=x-2 ; if left arrow key is pressed, move ship left by decreasing the x value by 2
If KeyDown (205) x=x+2 ; if right arrow key is pressed, move ship up by increasing the x value by 2
If KeyDown (208) y=y+2 ; if down key is pressed, move ship down by increasing the y value by 2
If KeyDown (57) PlaySound snd ; plays the laser sound if space bar is pressed
DrawImage player,x,y ; Draw the player image and puts it at the x and y coordinates
Flip ; flip the image into view and clear the back buffer
Wend
I am having problems on how to insert mp3s. I am a total beginner. but i looked in the manuals, searched the blitz site, looked at examples. but strangly. nothing?????
i want to know how i can load and play a mp3. thank you
============================================================
; LoadImage and DrawImage example
; Declares the GLOBAL variable which will be used throughout the program
Global player ; the player variable
Global snd ; sound variable
Global introPic ; intropic
Global x = 300 ; x coordinates of the player
Global y = 250 ; y coordinates of player
; Set a graphics mode
Graphics 800,600,16
; Set drawing operations for double buffering
SetBuffer BackBuffer()
; Load the image and assign its file handle to the variable
; - This assumes you have a graphic called player.bmp in the
; same folder as this source code
player=LoadImage("player.bmp") ; loads an image
snd = LoadSound ("amok.mp3") ; loads a sound file
intropic = LoadImage ("intro.jpg");
timer = CreateTimer(20)
DrawImage introPic, 1,1 ; draws intro pic
Flip ; flips it from back buffer
While Not KeyDown (57) ; waits for space bar to be pressed
Wend
;Starts a loop - this is the heart of the program
While Not KeyHit(1) ; this is saying : repeat until ESC key is hit. 1 is the scan code for the ESC key
Cls ; clear the screen
; moving the player around the screen
If KeyDown (200) y=y-2 ; if up arrow key is pressed, move ship up by decreasing the y value by 2
If KeyDown (203) x=x-2 ; if left arrow key is pressed, move ship left by decreasing the x value by 2
If KeyDown (205) x=x+2 ; if right arrow key is pressed, move ship up by increasing the x value by 2
If KeyDown (208) y=y+2 ; if down key is pressed, move ship down by increasing the y value by 2
If KeyDown (57) PlaySound snd ; plays the laser sound if space bar is pressed
DrawImage player,x,y ; Draw the player image and puts it at the x and y coordinates
Flip ; flip the image into view and clear the back buffer
Wend