level 1
liigk
楼主
RT,我最近做学校的作业是让用visual basic的form来做一个电子游戏。可是我不会写array。这是我现在有的。
For i = 1 To 50
If state = 6 Then bullet(i) = True Else : bullet(i) = False End If
If bullet(i) = True Then
If timer_counts = 0 Then e.Graphics.DrawImage(My.Resources.bullet_big, l(i), d(i), 16, 10)
l(i) += 1
If l(i) >= 700 Then
bullet(i) = False
End If
End If If bullet(i) = False Then l(i) = x + 105 d(i) = y + 20
End If Next
state是一个integer当我摁特定键的时候state就会变如果state=6 那么bullet就等于true 问题是我想让子弹每秒钟出现一个可是我这个程序只能让他一次性出现一个而且每当我把按键松开,子弹就凭空消失了。请问很如何解决????
2013年06月14日 00点06分
1
For i = 1 To 50
If state = 6 Then bullet(i) = True Else : bullet(i) = False End If
If bullet(i) = True Then
If timer_counts = 0 Then e.Graphics.DrawImage(My.Resources.bullet_big, l(i), d(i), 16, 10)
l(i) += 1
If l(i) >= 700 Then
bullet(i) = False
End If
End If If bullet(i) = False Then l(i) = x + 105 d(i) = y + 20
End If Next
state是一个integer当我摁特定键的时候state就会变如果state=6 那么bullet就等于true 问题是我想让子弹每秒钟出现一个可是我这个程序只能让他一次性出现一个而且每当我把按键松开,子弹就凭空消失了。请问很如何解决????