Visual basic yılan oyunu yapımı çok kolay

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Onaylı Üye
Katılım
9 May 2016
Mesajlar
103
Tepki puanı
2
Yaş
29
10 HİZMET YILI
Kod:
Dim yon, sonyon, yem As Integer
 
 
 
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 56 Then yon = 1
If KeyAscii = 54 Then yon = 2
If KeyAscii = 52 Then yon = 3
If KeyAscii = 53 Then yon = 4
If (sonyon = 1) And (yon = 4) Then yon = 1
If (sonyon = 2) And (yon = 3) Then yon = 2
If (sonyon = 3) And (yon = 2) Then yon = 3
If (sonyon = 4) And (yon = 1) Then yon = 4
If KeyAscii = 27 Then End
If KeyAscii = 45 Then Timer1.Interval = Timer1.Interval + 10
If KeyAscii = 43 Then Timer1.Interval = Timer1.Interval - 10
 
End Sub
 
Private Sub Form_Load()
yon = 1
sonyon = 1
yem = 0
y1.Top = 4950
y1.Left = 1065
asa = y1.Top
asd = y1.Left
 
 
 
 
End Sub
 
Private Sub Timer1_Timer()
If yem = 1 Then text1 = 1000
If yem = 2 Then text1 = 2000
 
 
 
If ((a.Top = b.Top) And (a.Left = b.Left)) Or ((a.Top = c.Top) And (a.Left = c.Left)) Or ((a.Top = d.Top) And (a.Left = d.Left)) Or ((a.Top = e.Top) And (a.Left = e.Left)) Or ((a.Top = f.Top) And (a.Left = f.Left)) Or ((a.Top = g.Top) And (a.Left = g.Left)) Or ((a.Top = h.Top) And (a.Left = h.Left)) Then
Timer1.Enabled = False
MsgBox ("Oyun Bitti!")
End If
If ((y1.Top = a.Top) And (y1.Left = a.Left) And (yem = 1)) Then
Timer1.Enabled = False
MsgBox ("Oyun Bitti!")
 
End If
 
 
 
 
 
 
If a.Top < 1000 Then
Timer1.Enabled = False
MsgBox ("Oyun Bitti!")
End If
 
If a.Left > 15000 Then
Timer1.Enabled = False
MsgBox ("Oyun Bitti!")
End If
 
If a.Top > 10500 Then
Timer1.Enabled = False
MsgBox ("Oyun Bitti!")
End If
 
If a.Left < 50 Then
Timer1.Enabled = False
MsgBox ("Oyun Bitti!")
End If
 
If (a.Top = y1.Top) And (a.Left = y1.Left) Then yem = yem + 1
 
If (a.Top = y2.Top) And (a.Left = y2.Left) Then yem = yem + 1
 
 
If yon = 1 Then
sonyon = 1
 
atop = a.Top
aleft = a.Left
 
a.Top = a.Top - 255
 
btop = b.Top
bleft = b.Left
b.Top = atop
b.Left = aleft
 
ctop = c.Top
cleft = c.Left
c.Top = btop
c.Left = bleft
 
dtop = d.Top
dleft = d.Left
d.Top = ctop
d.Left = cleft
 
etop = e.Top
eleft = e.Left
e.Top = dtop
e.Left = dleft
 
ftop = f.Top
fleft = f.Left
f.Top = etop
f.Left = eleft
 
gtop = g.Top
gleft = g.Left
g.Top = ftop
g.Left = fleft
 
htop = h.Top
hleft = h.Left
h.Top = gtop
h.Left = gleft
 
If yem = 1 Then
 
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2.Top = 4440
y2.Left = 4380
 
End If
 
If yem = 2 Then
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2top = y2.Top
y2left = y2.Left
y2.Top = y1top
y2.Left = y1left
 
End If
 
 
End If
 
If yon = 2 Then
sonyon = 2
atop = a.Top
aleft = a.Left
 
a.Left = a.Left + 255
 
btop = b.Top
bleft = b.Left
b.Top = atop
b.Left = aleft
 
ctop = c.Top
cleft = c.Left
c.Top = btop
c.Left = bleft
 
dtop = d.Top
dleft = d.Left
d.Top = ctop
d.Left = cleft
 
etop = e.Top
eleft = e.Left
e.Top = dtop
e.Left = dleft
 
ftop = f.Top
fleft = f.Left
f.Top = etop
f.Left = eleft
 
gtop = g.Top
gleft = g.Left
g.Top = ftop
g.Left = fleft
 
htop = h.Top
hleft = h.Left
h.Top = gtop
h.Left = gleft
 
If yem = 1 Then
 
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2.Top = 4440
y2.Left = 4380
End If
 
If yem = 2 Then
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2top = y2.Top
y2left = y2.Left
y2.Top = y1top
y2.Left = y1left
 
End If
End If
 
If yon = 3 Then
sonyon = 3
atop = a.Top
aleft = a.Left
 
a.Left = a.Left - 255
 
btop = b.Top
bleft = b.Left
b.Top = atop
b.Left = aleft
 
ctop = c.Top
cleft = c.Left
c.Top = btop
c.Left = bleft
 
dtop = d.Top
dleft = d.Left
d.Top = ctop
d.Left = cleft
 
etop = e.Top
eleft = e.Left
e.Top = dtop
e.Left = dleft
 
ftop = f.Top
fleft = f.Left
f.Top = etop
f.Left = eleft
 
gtop = g.Top
gleft = g.Left
g.Top = ftop
g.Left = fleft
 
htop = h.Top
hleft = h.Left
h.Top = gtop
h.Left = gleft
If yem = 1 Then
 
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2.Top = 4440
y2.Left = 4380
End If
 
If yem = 2 Then
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2top = y2.Top
y2left = y2.Left
y2.Top = y1top
y2.Left = y1left
 
End If
End If
 
 
If yon = 4 Then
sonyon = 4
atop = a.Top
aleft = a.Left
 
a.Top = a.Top + 255
 
btop = b.Top
bleft = b.Left
b.Top = atop
b.Left = aleft
 
ctop = c.Top
cleft = c.Left
c.Top = btop
c.Left = bleft
 
dtop = d.Top
dleft = d.Left
d.Top = ctop
d.Left = cleft
 
etop = e.Top
eleft = e.Left
e.Top = dtop
e.Left = dleft
 
ftop = f.Top
fleft = f.Left
f.Top = etop
f.Left = eleft
 
gtop = g.Top
gleft = g.Left
g.Top = ftop
g.Left = fleft
 
htop = h.Top
hleft = h.Left
h.Top = gtop
h.Left = gleft
If yem = 1 Then
 
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2.Top = 4440
y2.Left = 4380
End If
 
If yem = 2 Then
y1top = y1.Top
y1left = y1.Left
y1.Top = htop
y1.Left = hleft
y2top = y2.Top
y2left = y2.Left
y2.Top = y1top
y2.Left = y1left
 
End If
 
End If
 
 
 
 
 
 
 
End Sub
 
Onaylı Üye
Katılım
9 May 2016
Mesajlar
103
Tepki puanı
2
Yaş
29
10 HİZMET YILI
KingHack' Alıntı:
Teşekkürler. Yararlı Bir Konu Daha

Ben teşekkür ederim bazı arkadaşlar için yararlı konu oyun yapmak isteyenler içinde c++ hzır sourcemi paylaşılacaktır!
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst