Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Visual Basic'de Gelişmiş bir zıplayan top Oyunu Yapımı
#1
Rainbow 
Visual Basic'de Gelişmiş bir zıplayan top Oyunu Yapımı


Size belirttiğim gibi bir zıplayan top yapımını öğreteceğim.

Öncelikle forma neler koymalıyız hemen söyleyelim:

3 adet optionbutton
1 adet checkbox
1 adet shape
1 adet timer

Hemen kodları vereyim:

Code:
Private Sub Check1_click()
If Check1.Value = 1 Then
Timer1.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
Else
Timer1.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
End If
End Sub
Private Sub Option1_Click()
Timer1.Interval = "20"
End Sub

Private Sub Option2_Click()
Timer1.Interval = "12"
End Sub

Private Sub Option3_Click()
Timer1.Interval = "1"
End Sub

Private Sub Timer1_Timer()
Static ax, ay
If IsEmpty(ax) Then
ax = 100
ay = 100
End If

If Shape1.Top <= 0 Or Shape1.Top >= Form1.ScaleHeight - Shape1.Height Then
ay = -ay
Beep
End If

If Shape1.Left <= 0 Or Shape1.Left >= Form1.ScaleWidth - Shape1.Width Then
ax = -ax
Beep
End If

Shape1.Left = Shape1.Left + ax
Shape1.Top = Shape1.Top + ay
End Sub
[Image: vmpt.gif]
·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˜”*°•. || Türk Team - SaNcArHaN71 || .•°*”˜˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping