Help with my "RPG"?

Blitz3D Forums/Blitz3D Beginners Area/Help with my "RPG"?

Hi well um im trying to make a online rpg (dont know what to call it cause there is going to be a 30 people server limit) and i need help with sounds. I have a 14 second loop song called song.wav
and i need it to play in my code while the people are doing stuff. Here is my unfinished code:
Graphics 800,600,32,2
AppTitle "RPG" 
AutoMidHandle True 
SeedRnd(MilliSecs()) 
startup()

;Constants 


Const UPKEY=200 
Const DOWNKEY=208 
Const LEFTKEY=203 
Const RIGHTKEY=205 

;Images 
Global background=LoadImage("background.bmp")
Global wizard=LoadImage("wizard.bmp")
Global wizblur=LoadImage("wizard blur.bmp")
Global invis=LoadImage("invisable.bmp")
Global rat=LoadImage("rat.bmp")
Global wich=LoadImage("wich.bmp")
Global wichblur=LoadImage("wich blur.bmp")
Global man=LoadImage("man.bmp")
Global women=LoadImage("women.bmp")
Global mf$,name$,password$
Global curser=LoadImage("curser.bmp")



;Types 
Type player 
Field x,y 
Field hitpoints%
Field name$
End Type 

Type monster
Field hitpoints%
End Type


;Type INI 

Global player.player=New player 

;Initalization 

typeini() 

;Main Loop 
x = 50
y = 50

While Not KeyDown(1) ;Esc
Cls 


leveldraw() 

playermovement() 

leveltrans() 


HidePointer
DrawImage curser, MouseX (), MouseY ()
 

Flip 
Wend 

;Functions 

Function leveldraw() 

TileImage background

HUD()
If mf$="male"
DrawImage man,player\x,player\y
Else
If mf$="female"
DrawImage women,player\x,player\y
EndIf
EndIf 

End Function 


Function typeini() 
player\x=500 
player\y=100 
player\hitpoints%=10 
End Function 

Function playermovement() 

If KeyDown(UPKEY) 
player\y=player\y-3 
ElseIf KeyDown(DOWNKEY) 
player\y=player\y+3 
ElseIf KeyDown(RIGHTKEY) 
player\x=player\x+3 
ElseIf KeyDown(LEFTKEY) 
player\x=player\x-3 
EndIf 

End Function 

Function leveltrans() 
If player\x=>1018 
player\x=player\x-1017 
ElseIf player\x=<6 
player\x=player\x+1018 
ElseIf player\y=>701 
player\y=player\y-700 
ElseIf player\y=<5 
player\y=player\y+695 

EndIf 
End Function 

Function HUD() 
Color 250,0,0
Text 1,1,"Health: " + player\hitpoints% + ""
End Function


Function Startup()
Print "Checking for info"
filein = ReadFile("userfile.txt")
If filein <> 0
	name$ = ReadLine$(filein)
	password$ = ReadLine$(filein)
	mf$ = ReadLine$(filein)
	Print "Name: "+ name$ + ""
	pass$=Input("Password: ")
	If pass$=password$
	Print "Welcome!"
	Delay 2000
	Else
	Print "Wrong password."
	Delay 2000
	End
	EndIf 
Else
	Print "You are a new user, please create an account:
	Print ""
	name$ = Input$("Enter a new name: ")
	password$ = Input$("Enter a new Password: ")
	mf$ = Input("male or female: ")
	fileout = WriteFile("userfile.txt")
	WriteLine(fileout,name$)
	WriteLine(fileout,password)
	WriteLine(fileout,mf)
	CloseFile fileout
	Print ""
	Print "Thank you, you will be automatically logged in"
	Delay 3000
End If
CloseFile filein
End Function