22 Aralık 2012 Cumartesi

yumurta yakalama oyunu(egg capturing game)

YUMURTA YAKLAMA OYUNU








YUMURTA KAPMA OYUNU

DİZAYN İÇİN İÇİN GEREKLİ OLAN ELEMANLAR

7 adet pixturebox,5 adet Timer,1 adet colordialog,1 adet openfiledialog 

(1 tane picturebox kutu olarak , 6 tanesi yumurta olarak kullanılacak)








Dim düsen, puan As Integer

Dim ad As String

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load

düsen = 0

Me.CenterToScreen()

ad = InputBox("Adınızı Giriniz:""Oyuncu Bilgisi")

PictureBox1.Left = 10

PictureBox1.Top = 0

'------------------------------ 

PictureBox2.Left = 90

PictureBox2.Top = 0

'------------------------------

PictureBox3.Left = 170

PictureBox3.Top = 0

'------------------------------

PictureBox4.Left = 240

PictureBox4.Top = 0

'------------------------------

PictureBox5.Left = 320

PictureBox5.Top = 0

'------------------------------

PictureBox6.Left = 190

PictureBox6.Top = 270

MenuItem8.Checked = True

Timer1.Enabled = True

End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem3.Click

If puan <= 200 Then

Dim hayir As DialogResult

hayir = MessageBox.Show("Kaydetmek içIn yeterli puan almadınız","Açıklama", MessageBoxButtons.OK, MessageBoxIcon.Information)

Else

FileOpen(1, "d:deneme", OpenMode.Append)

WriteLine(1, ad, puan)

MsgBox("kaydedildi")

FileClose(1)

End If

End Sub

Private Sub MenuItem8_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem8.Click

Timer1.Interval = 100

Timer2.Interval = 100

Timer3.Interval = 100

Timer4.Interval = 100

Timer5.Interval = 100

End Sub

Private Sub MenuItem11_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem11.Click

Dim a As DialogResult

If DialogResult.Yes Then

MessageBox.Show("Eğer bir klasmanda 10 yumurta yere düşerse oyun biter.Her yumurta 5 puan değerindedir.Oyun puanınıza göre hızlanacaktır.Başarılar.""Kurallar", MessageBoxButtons.OK, MessageBoxIcon.Question)

End If

End Sub

Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem4.Click

ColorDialog1.ShowDialog()

Form1.ActiveForm.BackColor = ColorDialog1.Color

PictureBox1.BackColor = ColorDialog1.Color

PictureBox2.BackColor = ColorDialog1.Color

End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer2.Tick

If PictureBox3.Top < 250 Then

PictureBox3.Top = PictureBox3.Top + 5

End If

If PictureBox3.Left = PictureBox6.Left And PictureBox3.Top = 235 Then

PictureBox3.Visible = False

Form1.ActiveForm.Text = Val(Form1.ActiveForm.Text) + 5

puan = Val(Form1.ActiveForm.Text)

If puan = 100 Then

Timer1.Interval = 50

Timer2.Interval = 50

Timer3.Interval = 50

Timer4.Interval = 50

Timer5.Interval = 50

End If

If puan = 200 Then

FileOpen(1, "d:deneme", OpenMode.Append)

WriteLine(1, ad, puan)

MsgBox("kaydedildi")

FileClose(1)

End If

End If

If PictureBox3.Top = 235 And PictureBox6.Left <> PictureBox3.Left Then

düsen = düsen + 1

Beep()

If düsen = 10 Then

MsgBox("Oyun Bitti!", MsgBoxStyle.Critical)

End

End If

End If

If PictureBox3.Top = 250 Then

PictureBox3.Visible = True

Timer2.Enabled = False

Timer1.Enabled = False

Timer3.Enabled = True

Timer4.Enabled = False

Timer5.Enabled = True

PictureBox3.Top = -50

End If

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer1.Tick

If PictureBox1.Top < 250 Then

PictureBox1.Top = PictureBox1.Top + 5

End If

If PictureBox1.Left = PictureBox6.Left And PictureBox1.Top = 235 Then

PictureBox1.Visible = False

Form1.ActiveForm.Text = Val(Form1.ActiveForm.Text) + 5

puan = Val(Form1.ActiveForm.Text)

If puan = 100 Then

Timer1.Interval = 50

Timer2.Interval = 50

Timer3.Interval = 50

Timer4.Interval = 50

Timer5.Interval = 50

End If

If puan = 200 Then

FileOpen(1, "d:deneme", OpenMode.Append)

WriteLine(1, ad, puan)

MsgBox("kaydedildi")

FileClose(1)

End If

End If

If PictureBox1.Top = 235 And PictureBox6.Left <> PictureBox1.Left Then

düsen = düsen + 1

Beep()

If düsen = 10 Then

MsgBox("Oyun Bitti!", MsgBoxStyle.Critical)

End

End If

End If

If PictureBox1.Top = 250 Then

PictureBox1.Visible = True

PictureBox1.Top = -50

Timer1.Enabled = True

Timer2.Enabled = False

Timer5.Enabled = True

End If

End Sub

Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer3.Tick

If PictureBox4.Top < 250 Then

PictureBox4.Top = PictureBox4.Top + 5

End If

If PictureBox4.Left = PictureBox6.Left And PictureBox4.Top = 235 Then

PictureBox4.Visible = False

Form1.ActiveForm.Text = Val(Form1.ActiveForm.Text) + 5

puan = Val(Form1.ActiveForm.Text)

If puan = 100 Then

Timer1.Interval = 50

Timer2.Interval = 50

Timer3.Interval = 50

Timer4.Interval = 50

Timer5.Interval = 50

End If

If puan = 200 Then

FileOpen(1, "d:deneme", OpenMode.Append)

WriteLine(1, ad, puan)

MsgBox("kaydedildi")

FileClose(1)

End If

End If

If PictureBox4.Top = 235 And PictureBox6.Left <> PictureBox4.Left Then

düsen = düsen + 1

Beep()

If düsen = 10 Then

MsgBox("Oyun Bitti!", MsgBoxStyle.Critical)

End

End If

End If

If PictureBox4.Top = 250 Then

PictureBox4.Visible = True

PictureBox4.Top = -50

Timer2.Enabled = True

Timer1.Enabled = False

Timer3.Enabled = False

Timer4.Enabled = True

Timer5.Enabled = False

End If

End Sub

Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer4.Tick

If PictureBox5.Top < 250 Then

PictureBox5.Top = PictureBox5.Top + 5

End If

If PictureBox5.Left = PictureBox6.Left And PictureBox5.Top = 235 Then

PictureBox5.Visible = False

Form1.ActiveForm.Text = Val(Form1.ActiveForm.Text) + 5

puan = Val(Form1.ActiveForm.Text)

If puan = 100 Then

Timer1.Interval = 50

Timer2.Interval = 50

Timer3.Interval = 50

Timer4.Interval = 50

Timer5.Interval = 50

End If

If puan = 200 Then

FileOpen(1, "d:deneme", OpenMode.Append)

WriteLine(1, ad, puan)

MsgBox("kaydedildi")

FileClose(1)

End If

End If

If PictureBox5.Top = 235 And PictureBox6.Left <> PictureBox5.Left Then

düsen = düsen + 1

Beep()

If düsen = 10 Then

MsgBox("Oyun Bitti!", MsgBoxStyle.Critical)

End

End If

End If

If PictureBox5.Top = 250 Then

PictureBox5.Visible = True

PictureBox5.Top = -50

Timer2.Enabled = False

Timer1.Enabled = True

Timer3.Enabled = True

Timer5.Enabled = False

Timer4.Enabled = True

End If

End Sub

Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer5.Tick

If PictureBox2.Top < 250 Then

PictureBox2.Top = PictureBox2.Top + 5

End If

If PictureBox2.Left = PictureBox6.Left And PictureBox2.Top = 235 Then

PictureBox2.Visible = False

Form1.ActiveForm.Text = Val(Form1.ActiveForm.Text) + 5

puan = Val(Form1.ActiveForm.Text)

If puan = 100 Then

Timer1.Interval = 50

Timer2.Interval = 50

Timer3.Interval = 50

Timer4.Interval = 50

Timer5.Interval = 50

End If

If puan = 200 Then

FileOpen(1, "d:deneme", OpenMode.Append)

WriteLine(1, ad, puan)

MsgBox("kaydedildi")

FileClose(1)

End If

End If

If PictureBox2.Top = 235 And PictureBox6.Left <> PictureBox2.Left Then

düsen = düsen + 1

Beep()

If düsen = 10 Then

MsgBox("Oyun Bitti!", MsgBoxStyle.Critical)

End

End If

End If

If PictureBox2.Top = 250 Then

PictureBox2.Visible = True

PictureBox2.Top = -50

Timer2.Enabled = False

Timer1.Enabled = False

Timer3.Enabled = True

Timer4.Enabled = False

End If

End Sub

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

If e.KeyCode = Keys.Left And PictureBox6.Left > 0 Then 'sol yön tuşuna basarsa

PictureBox6.Left = PictureBox6.Left - 10

ElseIf e.KeyCode = Keys.Right And PictureBox6.Left < 340 Then 'sağ yön tuşuna basarsa

PictureBox6.Left = PictureBox6.Left + 10

End If

End Sub

Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem7.Click

Timer1.Interval = 250

Timer2.Interval = 250

Timer3.Interval = 250

Timer4.Interval = 250

Timer5.Interval = 250

End Sub

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem2.Click

Me.Hide()

Me.Text = 0

Me.ShowDialog()

End Sub

Private Sub MenuItem9_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem9.Click

Timer1.Interval = 50

Timer2.Interval = 50

Timer3.Interval = 50

Timer4.Interval = 50

Timer5.Interval = 50

End Sub

Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem5.Click

End

End Sub

Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem12.Click

If OpenFileDialog1.ShowDialog = DialogResult.OK Then

FileOpen(1, "d:deneme", OpenMode.Input)

Do Until EOF(1)

MsgBox(LineInput(1) & Chr(13) & Chr(10))

Loop

End If

End Sub

Private Sub MenuItem14_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem14.Click

Dim trt As DialogResult

If DialogResult.Yes Then

MessageBox.Show("yumurta hızları vb""Yardım Konuları", MessageBoxButtons.OK, MessageBoxIcon.Information)

End If

End Sub

Private Sub Form1_Closed(ByVal sender As Object, ByVal e AsSystem.EventArgs) Handles MyBase.Closed

MsgBox(ad, MsgBoxStyle.Information, puan)

End Sub



Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object,ByVal e As System.ComponentModel.CancelEventArgs)



End Sub



Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object,ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk



End Sub



Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles PictureBox5.Click



End Sub



Private Sub PictureBox6_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles PictureBox6.Click



End Sub



Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem1.Click



End Sub



Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem6.Click



End Sub



Private Sub MenuItem10_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem10.Click



End Sub



Private Sub MenuItem13_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem13.Click



End Sub



Private Sub MenuItem15_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem15.Click



End Sub



Private Sub MenuItem16_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem16.Click



End Sub



Private Sub MenuItem17_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MenuItem17.Click



End Sub



Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles PictureBox1.Click



End Sub



Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles PictureBox2.Click



End Sub



Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles PictureBox3.Click



End Sub



Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles PictureBox4.Click



End Sub

End Class

Hiç yorum yok:

Yorum Gönder