毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> 开发语言 >> 正文

vb双缓冲画平滑曲线闪烁严重 第3页

更新时间:2012-7-31:  来源:毕业论文
    
    
  stack_h = 0
  isdone = True
  For i = 0 To 5
  For j = 0 To 5
  If arr(i, j) > 4 Then
  arr(i, j) = 0
  stack(stack_h).x = i
  stack(stack_h).y = j
  stack_h = stack_h + 1
   
  End If
  Next j
  Next i
   
  Dim a As Long, b As Long
  For i = 0 To stack_h - 1
  a = stack(i).x
  b = stack(i).y
  '左边
  a = a - 1
  Do While a >= 0
  If arr(a, b) = 0 Then
  a = a - 1
  Else
  arr(a, b) = arr(a, b) + 1
  Exit Do
  End If
  Loop

   
  a = stack(i).x + 1
  '右边
  Do While a < 6
  If arr(a, b) = 0 Then
  a = a + 1
  Else
  arr(a, b) = arr(a, b) + 1
  Exit Do
  End If
  Loop
   
  a = stack(i).x
  b = stack(i).y - 1
  '上边
  Do While b >= 0
  If arr(a, b) = 0 Then
  b = b - 1
  Else
  arr(a, b) = arr(a, b) + 1
  Exit Do
  End If
  Loop
   
   
  a = stack(i).x
  b = stack(i).y + 1
  '下边
  Do While b < 6
  If arr(a, b) = 0 Then
  b = b + 1
  Else
  arr(a, b) = arr(a, b) + 1
  Exit Do
  End If
  Loop
  Next i
   
   
  '检查下一秒还有没有需要爆的?,没有就停止计时器
  For i = 0 To 5
  For j = 0 To 5
  If arr(i, j) > 4 Then
  isdone = False
  End If
  Next j
  Next i
   
  If isdone = True Then Timer1.Enabled = False
   
'检查是否完成本局了?
  isdone = True
  For i = 0 To 5
  For j = 0 To 5
  If arr(i, j) > 0 Then
  isdone = False
  End If
  Next j
  Next i
   
  If isdone = True Then
  MsgBox "本局完成,加一水滴,开始下一局"
  drops = drops + 1
  newgame
  End If
   
  calcDC
  Me.Refresh
End Sub

Sub newgame()
  FillRect mDC, R, GetSysColorBrush(COLOR_WINDOW)
   
  Randomize

  Dim str As String
  Dim i As Long, j As Long
  For i = 0 To 5
  For j = 0 To 5
  arr(i, j) = Rnd * 4
  str = arr(i, j)
  If str <> "0" Then
  Call TextOut(mDC, 67 * i + 20, 67 * j, str, LenB(str) - 1)
  End If
  Next j
  Next i
   
  calcDC
  Me.Refresh

上一页  [1] [2] [3] [4] 下一页

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。