Type=Activity
Version=4.3
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: False
#End Region
'در این قسمت صدای حیوانی پخش و کودک باید ان را تشخیص دهد
Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
Dim sSelect As String
	Dim img1,img2,img3,img4,img5,img6,img7,img8,img9,img10,img11,img12 As ImageView
	Dim imgbackground As ImageView
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("game5")
common.changeTheme(imgbackground)
Dim sList(12) As String
sList(0) = "cat"
sList(1) = "chicken"
sList(2) = "cow"
sList(3) = "dog"
sList(4) = "duck"
sList(5) = "elephant"
sList(6) = "ghorbaghe"
sList(7) = "horse"
sList(8) = "joghd"
sList(9) = "khar"
sList(10) = "lion"
sList(11) = "monkey"
Dim i1 As Int
i1 = Rnd(0,11)
sSelect = sList(i1)
common.playAudio(sSelect & ".mp3")
'common.playAnimation(img1,"alpha",500)
'common.playAnimation(img2,"alpha",500)
'common.playAnimation(img3,"alpha",500)
'common.playAnimation(img4,"alpha",500)
'common.playAnimation(img5,"alpha",500)
'common.playAnimation(img6,"alpha",500)
'common.playAnimation(img7,"alpha",500)
'common.playAnimation(img8,"alpha",500)
'common.playAnimation(img9,"alpha",500)
'common.playAnimation(img10,"alpha",500)
'common.playAnimation(img11,"alpha",500)
'common.playAnimation(img12,"alpha",500)
ToastMessageShow("شروع شد",False)
loadMenu
End Sub
Sub loadMenu
Activity.AddMenuItem2("تنظیمات","btnsetting",LoadBitmap(File.DirAssets,"setting.png"))
Activity.AddMenuItem2("درباره ما","btnabout",LoadBitmap(File.DirAssets,"about.png"))
Activity.AddMenuItem2("خروج","exit1",LoadBitmap(File.DirAssets,"exit.png"))
End Sub
Sub btnsetting_Click
Activity.Finish
StartActivity(setting)
End Sub
Sub btnabout_Click
Activity.Finish
StartActivity(frmabout)
End Sub
Sub exit1_Click
Dim i As Int
i = Msgbox2("آیا مایل به خروج هستید؟","خروج","آری","خیر","",Null)
If i = DialogResponse.POSITIVE Then
 ExitApplication
End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub CheckItem(c1 As ImageView)
Dim i1 As Int
If c1.Tag <> sSelect Then
  common.playAudio("wrong.wav")
  common.playAnimation(c1,"scale",1000)
  c1.Visible = False
  common.vibrePhone
  ToastMessageShow("اشتباه بود",False)
Else
  common.playAudio("win.mp3")
  i1 = Msgbox2("گل گفتی آی گل گفتی مثل یه بلبل گفتی","آفرین","دوباره","خروج","",Null)
  common.playAnimation(c1,"scale1",500)
  If i1 = DialogResponse.POSITIVE Then
   Activity_Create(False)
  Else
   Activity.Finish
   StartActivity(Main)
  End If
End If
End Sub

Sub img9_Click
 CheckItem(img9)
End Sub
Sub img8_Click
 CheckItem(img8)	
End Sub
Sub img7_Click
 CheckItem(img7)
End Sub
Sub img6_Click
 CheckItem(img6)
End Sub
Sub img5_Click
 CheckItem(img5)
End Sub
Sub img4_Click
 CheckItem(img4)
End Sub
Sub img3_Click
 CheckItem(img3)
End Sub
Sub img2_Click
 CheckItem(img2)
End Sub
Sub img12_Click
 CheckItem(img12)
End Sub
Sub img11_Click
 CheckItem(img11)
End Sub
Sub img10_Click
 CheckItem(img10)
End Sub
Sub img1_Click
CheckItem(img1)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
  If KeyCode = KeyCodes.KEYCODE_BACK Then
   Activity.Finish
   common.stopAudio   
   StartActivity(Main)
  End If
  If KeyCode = KeyCodes.KEYCODE_MENU Then
   Activity.OpenMenu
  End If
End Sub