//NOTE: For this example to work you will need to copy 'Playerhit.wav'
//to the media folder at the location where you are running this example.
//The file can be found in your [AGK Install Directory]/Projects/Basic/Examples/Games/SpaceShooter/media/space
Setvirtualresolution(640,480)
ResetTimer()
//Check for required files in media folder
fileok=GetFileExists("Playerhit.wav")
If fileok<>1
Repeat
Print ("Playerhit.wav needs to be in your media folder")
Sync()
Until Timer()>5
EndIF
If fileok=1
AddVirtualButton(1,200,240,80)
SetVirtualButtonText(1,"Vol+")
AddVirtualButton(2,400,240,80)
SetVirtualButtonText(2,"Vol-")
sound = LoadSound("Playerhit.wav")
volume=50
PlaySound(sound,volume,1,0)
Repeat
Print(Volume)
If GetVirtualButtonPressed(1)
volume=volume+1
SetSoundSystemVolume(volume)
EndIf
If GetVirtualButtonPressed(2)
volume=volume-1
SetSoundSystemVolume(volume)
EndIf
Sync()
Until Timer()>30
DeleteSound(sound)
Print ("Sound Deleted")
Sync()
Sleep(2000)
EndIf
End
Help make AGK better by submitting an example for this command! (All examples are subject to approval)