• توجه: در صورتی که از کاربران قدیمی ایران انجمن هستید و امکان ورود به سایت را ندارید، میتوانید با آیدی altin_admin@ در تلگرام تماس حاصل نمایید.

بازي مار و پله

ahmadfononi

معاونت انجمن
اين برنامه بازي مار و پله را انجام مي دهد . طراحي پس زمينه و قرار گرفتن مارها وپله ها در فتو شاپ انجام مي شود و روي تمامي خانه هاي بازي در وي بي كنترل image قرار داده مي شود كه بتوانند مهره را در محل مورد نظر به صورت يك تصوير بارگذاري كنند از يك جعبه متن هم براي نمايش مقدار تا س كمك گرفته ايم چنانچه علاقمندان در زمينه طراحي قسمت گرافيك و قرار دادن اشيا با مشكل مواجه شدند مي توانم طرح گرافيكي آن را برايشان ايميل كنم
با تشكر پريسا زارعي

Public a As Boolean
Public b, r As String
Public p, p1 As String
Public t, h, s, lastindex, lastindex1 As Integer

Private Sub Command1_Click()
Randomize
Text1.Text = Round(1 + Rnd(1) * 5)
b = Text1.Text
If a = True Then
Shape2.Visible = True
Shape1.Visible = False
a = False
Else
Shape2.Visible = False
Shape1.Visible = True
a = True
End If
If b = "6" Then
If a = True Then
Shape2.Visible = True
Shape1.Visible = False
Else
If a = False Then
Shape2.Visible = False
Shape1.Visible = True
End If
End If
End If
If b = "6" Then
h = 1
End If
If h = 1 Then
s = 1
End If
End Sub
 

ahmadfononi

معاونت انجمن
Private Sub Command2_Click()
End
End Sub

Private Sub Form_activate()
a = True
Text1.Locked = True
End Sub

Private Sub Image2_Click(Index As Integer)
If s = 1 Then
If (lastindex = Index) Or (lastindex1 = Index) Then
If (Index + b) <= 99 Then
If b = "6" Then
Select Case a
Case False
If Image2(Index).Tag = "yellow" Then
Image2(Index + 6).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(Index + 6).Tag = "yellow"
Image2(Index).Picture = LoadPicture("")
lastindex = Index + 6
Index = Index + 6
a = False
End If
Case True
If Image2(Index).Tag = "red" Then
Image2(Index + 6).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(Index + 6).Tag = "red"
Image2(Index).Picture = LoadPicture("")
lastindex1 = Index + 6
Index = Index + 6
a = True
End If
End Select
Else
Select Case a
Case True
If Image2(Index).Tag = "yellow" Then
Image2(Index + b).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(Index + b).Tag = "yellow"
Image2(Index).Picture = LoadPicture("")
lastindex = Index + b
Index = Index + b
a = True
End If
Case False
If Image2(Index).Tag = "red" Then
Image2(Index + b).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(Index + b).Tag = "red"
Image2(Index).Picture = LoadPicture("")
lastindex1 = Index + b
Index = Index + b
a = False
End If
End Select
End If
Select Case Index
Case 36
Select Case a
Case False
If Image2(36).Tag = "red" Then
Image2(2).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(36).Picture = LoadPicture("")
Image2(36 + b).Picture = LoadPicture("")
Image2(2).Tag = "red"
Index = 2
lastindex1 = 2
a = False
End If​
 

ahmadfononi

معاونت انجمن
Case True
If Image2(36).Tag = "yellow" Then
Image2(2).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(36).Picture = LoadPicture("")
Image2(36 + b).Picture = LoadPicture("")
Image2(2).Tag = "yellow"
Index = 2
lastindex = 2
a = True
End If
End Select
Case 46
Select Case a
Case False
If Image2(46).Tag = "red" Then
Image2(12).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(46).Picture = LoadPicture("")
Image2(46 + b).Picture = LoadPicture("")
Image2(12).Tag = "red"
Index = 12
lastindex1 = 12
a = False
End If
Case True
If Image2(46).Tag = "yellow" Then
Image2(12).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(46).Picture = LoadPicture("")
Image2(46 + b).Picture = LoadPicture("")
Image2(12).Tag = "yellow"
Index = 12
lastindex = 12
a = True
End If
End Select
Case 87
Select Case a
Case False
If Image2(87).Tag = "red" Then
Image2(69).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(87).Picture = LoadPicture("")
Image2(87 + b).Picture = LoadPicture("")
Image2(69).Tag = "red"
Index = 69
lastindex1 = 69
a = False
End If
Case True
If Image2(287).Tag = "yellow" Then
Image2(69).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(87).Picture = LoadPicture("")
Image2(87 + b).Picture = LoadPicture("")
Image2(69).Tag = "yellow"
Index = 69
lastindex = 69
a = True
End If
End Select
Case 96
Select Case a
Case False
If Image2(96).Tag = "red" Then
Image2(77).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(96).Picture = LoadPicture("")
Image2(96 + b).Picture = LoadPicture("")
Image2(77).Tag = "red"
Index = 77
lastindex1 = 77
a = False
End If​
 

ahmadfononi

معاونت انجمن
Case True
If Image2(96).Tag = "yellow" Then
Image2(77).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(96).Picture = LoadPicture("")
Image2(96 + b).Picture = LoadPicture("")
Image2(77).Tag = "yellow"
Index = 77
lastindex = 77
a = True
End If
End Select
Case 5
Select Case a
Case False
If Image2(5).Tag = "red" Then
Image2(34).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(5).Picture = LoadPicture("")
Image2(5 + b).Picture = LoadPicture("")
Image2(34).Tag = "red"
Index = 34
lastindex1 = 34
a = False
End If
Case True
If Image2(5).Tag = "yellow" Then
Image2(34).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(5).Picture = LoadPicture("")
Image2(5 + b).Picture = LoadPicture("")
Image2(34).Tag = "yellow"
Index = 34
lastindex = 34
a = True
End If
End Select
Case 31
Select Case a
Case False
If Image2(31).Tag = "red" Then
Image2(52).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(31).Picture = LoadPicture("")
Image2(31 + b).Picture = LoadPicture("")
Image2(52).Tag = "red"
Index = 52
lastindex1 = 52
a = False
End If
Case True
If Image2(31).Tag = "yellow" Then
Image2(52).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(31).Picture = LoadPicture("")
Image2(31 + b).Picture = LoadPicture("")
Image2(52).Tag = "yellow"
Index = 52
lastindex = 52
a = True
End If
End Select
Case 42
Select Case a
Case False
If Image2(42).Tag = "red" Then
Image2(61).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(42).Picture = LoadPicture("")
Image2(42 + b).Picture = LoadPicture("")
Image2(61).Tag = "red"
Index = 61
lastindex1 = 61
a = False
End If​
 

ahmadfononi

معاونت انجمن
Case True
If Image2(42).Tag = "yellow" Then
Image2(61).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(42).Picture = LoadPicture("")
Image2(42 + b).Picture = LoadPicture("")
Image2(61).Tag = "yellow"
Index = 61
lastindex = 61
a = True
End If
End Select
Case 75
Select Case a
Case False
If Image2(75).Tag = "red" Then
Image2(94).Picture = LoadPicture(App.Path + "\fa.jpg")
Image2(75).Picture = LoadPicture("")
Image2(75 + b).Picture = LoadPicture("")
Image2(94).Tag = "red"
Index = 94
lastindex1 = 94
a = False
End If
Case True
If Image2(75).Tag = "yellow" Then
Image2(94).Picture = LoadPicture(App.Path + "\fah.jpg")
Image2(75).Picture = LoadPicture("")
Image2(75 + b).Picture = LoadPicture("")
Image2(94).Tag = "yellow"
Index = 94
lastindex = 94
a = True
End If
End Select
End Select
End If​
 

ahmadfononi

معاونت انجمن
If lastindex = lastindex1 Then
Select Case a
Case True
Image3.Picture = LoadPicture(App.Path + "\fa.jpg")
Case False
Image4.Picture = LoadPicture(App.Path + "\fah.jpg")
End Select
End If
End If
Else
w = MsgBox("error", vbOKOnly + vbCritical, "error")
If Image2(Index).Tag = "yellow" Then
Image2(Index).Picture = LoadPicture(App.Path + "\fah.jpg")
lastindex = Index
Else
If Image2(Index).Tag = "red" Then
Image2(Index).Picture = LoadPicture(App.Path + "\fa.jpg")
lastindex1 = Index
End If
End If
End If
If Index = 99 Then
r = Image2(Index).Tag
t = MsgBox("the " + r + " win", vbOKOnly + vbCritical, "resualt game")
Command1.Enabled = False
Command2.Enabled = True
End If
End Sub

Private Sub Image3_Click()
If b = "6" Then
Image2(0).Picture = LoadPicture(App.Path + "\fa.jpg")
Image3.Picture = LoadPicture("")
Image2(0).Tag = "red"
Index = 0
lastindex1 = 0
a = True
p = Image2(0).Tag
End If
End Sub​
 

ahmadfononi

معاونت انجمن
Private Sub Image4_Click()
If b = "6" Then
Image2(0).Picture = LoadPicture(App.Path + "\fah.jpg")
Image4.Picture = LoadPicture("")
Image2(0).Tag = "yellow"
Index = 0
lastindex = 0
a = False
p1 = Image2(0).Tag
End If
End Sub​
 
بالا