kİremiKıRMA!!!
Formdakıler
1)ıkı tane timer
2)1 tane command buton
3)1 tane label
4)1 tane shape
5)1 tane dızı olusturulmus picture1(0)
*not:5 sıradakı nesneyı olusturmak ıcın foruma bı tane picture1 koyun ve ona sag tıklayın copy dıyın daha sonra formun herhangı bır yerıne sag tıklayın ve paste dıyın sıze bı uyarı gelır dızı olusturmak ıstıyomusunuz dıye evet dıyın dızı olusturulmus pıctureniz hazırdır bıde assagıdakı kodları pastelıyın ve deneyın.
Option Explicit
Dim satsay, sutsay, kutsay, puan
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = Command1.Left + X
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft: 'sol
Command1.Left = Command1.Left - 15
If Command1.Left <= 0 Then Command1.Left = 0
Case vbKeyRight: 'sağ
Command1.Left = Command1.Left + 15
If Command1.Left >= Form1.ScaleWidth - Command1.Width Then Command1.Left = Form1.ScaleWidth - Command1.Width
End Select
End Sub
Private Sub Form_Load()
Dim i, j, k
Show
ScaleMode = 3 'pixel
KeyPreview = True
satsay = 5
sutsay = 10
kutsay = satsay * sutsay
Command1.Caption = ""
Timer1.Interval = 10
Timer2.Interval = 10
Command1.Top = ScaleHeight - 50
Label1.Top = ScaleHeight - Label1.Height
Label1.Left = 0
Label1 = "0"
Shape1.Shape = 3
Shape1.FillStyle = 7
Shape1.Width = 18
Shape1.Height = 18
Picture1(0).Width = 60
Picture1(0).Height = 20
Width = Picture1(0).Width * sutsay * Screen.TwipsPerPixelX + 30
Picture1(0).Move 0, 0
Picture1(0).BackColor = QBColor(1)
For i = 1 To satsay
For j = 1 To sutsay
k = k + 1
Load Picture1(k)
Picture1(k).Left = Picture1(k - 1).Left + Picture1(k).Width
Picture1(k).Top = (i - 1) * Picture1(k).Height
Picture1(k).Visible = True
Picture1(k).BackColor = QBColor(i)
Next
Picture1(k).Left = 0
Next
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = X
End Sub
Private Sub Timer1_Timer()
Static xa, ya
If IsEmpty(xa) Then xa = 10: ya = 10
If Shape1.Left <= 0 Then xa = -xa
If Shape1.Left >= ScaleWidth Then xa = -xa
If Shape1.Top < 0 Then ya = -ya
If (Shape1.Top + 10 >= Command1.Top) And (Shape1.Top < (Command1.Top + Command1.Height)) And Shape1.Left > Command1.Left And Shape1.Left < (Command1.Left + Command1.Width) Then ya = -ya
If Shape1.Top >= ScaleHeight Then
MsgBox ("oyun bitti")
Timer1.Interval = False
End
End If
Dim i, j, k
k = -1
For i = 1 To sutsay
For j = 1 To satsay
k = k + 1
If Picture1(k).Visible = True And Shape1.Left >= Picture1(k).Left And Shape1.Left < (Picture1(k).Left + Picture1(k).Width) And Shape1.Top >= Picture1(k).Top And Shape1.Top <= (Picture1(k).Top + Picture1(k).Height) Then
Picture1(k).Visible = False
kutsay = kutsay - 1
ya = -ya
puan = puan + 100
Label1 = puan
End If
Next
Next
Shape1.Left = Shape1.Left + xa
Shape1.Top = Shape1.Top + ya
If kutsay = 0 Then
MsgBox ("tebrikler ederim efendim")
End
End If
Formdakıler
1)ıkı tane timer
2)1 tane command buton
3)1 tane label
4)1 tane shape
5)1 tane dızı olusturulmus picture1(0)
*not:5 sıradakı nesneyı olusturmak ıcın foruma bı tane picture1 koyun ve ona sag tıklayın copy dıyın daha sonra formun herhangı bır yerıne sag tıklayın ve paste dıyın sıze bı uyarı gelır dızı olusturmak ıstıyomusunuz dıye evet dıyın dızı olusturulmus pıctureniz hazırdır bıde assagıdakı kodları pastelıyın ve deneyın.
Option Explicit
Dim satsay, sutsay, kutsay, puan
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = Command1.Left + X
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft: 'sol
Command1.Left = Command1.Left - 15
If Command1.Left <= 0 Then Command1.Left = 0
Case vbKeyRight: 'sağ
Command1.Left = Command1.Left + 15
If Command1.Left >= Form1.ScaleWidth - Command1.Width Then Command1.Left = Form1.ScaleWidth - Command1.Width
End Select
End Sub
Private Sub Form_Load()
Dim i, j, k
Show
ScaleMode = 3 'pixel
KeyPreview = True
satsay = 5
sutsay = 10
kutsay = satsay * sutsay
Command1.Caption = ""
Timer1.Interval = 10
Timer2.Interval = 10
Command1.Top = ScaleHeight - 50
Label1.Top = ScaleHeight - Label1.Height
Label1.Left = 0
Label1 = "0"
Shape1.Shape = 3
Shape1.FillStyle = 7
Shape1.Width = 18
Shape1.Height = 18
Picture1(0).Width = 60
Picture1(0).Height = 20
Width = Picture1(0).Width * sutsay * Screen.TwipsPerPixelX + 30
Picture1(0).Move 0, 0
Picture1(0).BackColor = QBColor(1)
For i = 1 To satsay
For j = 1 To sutsay
k = k + 1
Load Picture1(k)
Picture1(k).Left = Picture1(k - 1).Left + Picture1(k).Width
Picture1(k).Top = (i - 1) * Picture1(k).Height
Picture1(k).Visible = True
Picture1(k).BackColor = QBColor(i)
Next
Picture1(k).Left = 0
Next
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = X
End Sub
Private Sub Timer1_Timer()
Static xa, ya
If IsEmpty(xa) Then xa = 10: ya = 10
If Shape1.Left <= 0 Then xa = -xa
If Shape1.Left >= ScaleWidth Then xa = -xa
If Shape1.Top < 0 Then ya = -ya
If (Shape1.Top + 10 >= Command1.Top) And (Shape1.Top < (Command1.Top + Command1.Height)) And Shape1.Left > Command1.Left And Shape1.Left < (Command1.Left + Command1.Width) Then ya = -ya
If Shape1.Top >= ScaleHeight Then
MsgBox ("oyun bitti")
Timer1.Interval = False
End
End If
Dim i, j, k
k = -1
For i = 1 To sutsay
For j = 1 To satsay
k = k + 1
If Picture1(k).Visible = True And Shape1.Left >= Picture1(k).Left And Shape1.Left < (Picture1(k).Left + Picture1(k).Width) And Shape1.Top >= Picture1(k).Top And Shape1.Top <= (Picture1(k).Top + Picture1(k).Height) Then
Picture1(k).Visible = False
kutsay = kutsay - 1
ya = -ya
puan = puan + 100
Label1 = puan
End If
Next
Next
Shape1.Left = Shape1.Left + xa
Shape1.Top = Shape1.Top + ya
If kutsay = 0 Then
MsgBox ("tebrikler ederim efendim")
End
End If
