#Include "Ninfa3d.bi"

dim Shared camera As nCAMERA

Dim As nSOUND sound02,sound03,sound04,sound05,sound06
Dim font01 As nFONT

'Enable vertical synch.
EnableVsync()

'Starts the Ninfa3D Engine
InitEngine(640,480,32,0)
	BackGroundColor(64,64,64)'Background color

'Include the file "SampleFuntions.bi.
'It contains useful features, such as drawing the interface and create the test area.
#Include "SampleFunctions.bi"

'Create a camera
camera = CreateCamera()

font01 = LoadFont("media\courier.xml")'Load the font, in format XML

'Load the sounds.
sound02 = LoadSound("media\cow.wav")
	SoundType(sound02,1)'Type sound, in this case 3D.
sound03 = LoadSound("media\cat.wav")
	SoundType(sound03,1)'Type sound, in this case 3D.
sound04 = LoadSound("media\horse.wav")
	SoundType(sound04,1)'Type sound, in this case 3D.
sound05 = LoadSound("media\chicken.wav")
	SoundType(sound05,1)'Type sound, in this case 3D.
sound06 = LoadSound("media\Dog.wav")
	SoundType(sound06,1)'Type sound, in this case 3D.

While(EngineRun)'Returns 1 if the engine is running.

	'Begins scene
	BeginScene()
	
	'By pressing the "ESCAPE" closes the engine.
	If KeyHit(KEY_ESCAPE) Then CloseEngine()
	
	'Update the Engine.
	'Changing the value (only affects the physics) that will update the
	'Physical faster or slower.
	UpdateEngine(0)
	
	Font(font01)'assign the font to use

	Text(320,80,"2D SOUNDS",1,1)
	
	Text(250,140,"Press 1 --> Cow",0,0)'Text
	If KeyHit(KEY_1) THEN PlaySound(sound02)'Active the sound
	
	Text(250,160,"Press 2 --> Cat",0,0)
	If KeyHit(KEY_2) Then PlaySound(sound03)'Active the sound

	Text(250,180,"Press 3 --> Horse",0,0)
	If KeyHit(KEY_3) Then PlaySound(sound04)'Active the sound
	
	Text(250,200,"Press 4 --> Chicken",0,0)
	If KeyHit(KEY_4) Then PlaySound(sound05)'Active the sound
	
	Text(250,220,"Press 5 --> Dog",0,0)
	If KeyHit(KEY_5) Then PlaySound(sound06)'Active the sound

	'Displays the interface (FPS and triangles)
	Interface()
	
	'End the scene
	EndScene()
	
Wend

'Ends Ninfa3D Engine
EndEngine()