Is there any way I can speed this up?
VB Code:
Private Sub GameLoop() Do Until boolPlay = False DoEvents intX1 = intX1 + 5 * intLevel intY1 = intY1 + 5 * intLevel 'put the background on the form RetVal = BitBlt(Me.hDC, 0, 0, picBack.ScaleWidth, picBack.ScaleHeight, picBack.hDC, 0, 0, SRCCOPY) 'picBuffer.Cls 'put the sprite on the form RetVal = BitBlt(Me.hDC, intX1, intY1, 67, 79, picSprite.hDC, 67, 0, SRCAND) RetVal = BitBlt(Me.hDC, intX1, intY1, 67, 79, picSprite.hDC, 0, 0, SRCPAINT) 'copy the buffer to the form 'RetVal = BitBlt(Me.hDC, 0, 0, picBuffer.ScaleWidth, picBuffer.ScaleHeight, picBuffer.hDC, 0, 0, SRCCOPY) frmMeteor.Refresh Loop End Sub
I used to use a buffer but that only slowed it down even more...




Reply With Quote