Hello, Im developing a platform game but now I'm stuck. Here's the code I'm using to draw all the tiles:
VB Code:
Dim offset1 As POINTAPI Dim offset2 As POINTAPI Dim X As Long, Y As Long X = iCurPos.X Y = iCurPos.Y offset1.X = (X - picBackBuffer.ScaleWidth / 2) ' / 32 offset1.Y = (Y - picBackBuffer.ScaleHeight / 2) '/ 32 If X < picBackBuffer.ScaleWidth / 2 Then offset1.X = 0 If Y < picBackBuffer.ScaleHeight / 2 Then offset1.Y = 0 For iX = 0 To UBound(Map, 1) For iY = 0 To UBound(Map, 2) BitBlt picBackBuffer.hDC, iX * 32 - offset1.X, iY * 32 - offset1.Y, 32, 32, picTiles.hDC, Map(iX, iY).TileSrcX, Map(iX, iY).TileSrcY, vbSrcCopy Next iY Next iX X = X - (iCurPos.X - picBackBuffer.ScaleWidth / 2) Y = Y - (iCurPos.Y - picBackBuffer.ScaleHeight / 2) DrawPlayer iCurPos.X - offset1.X, iCurPos.Y - offset1.Y, offset1.X, offset1.Y
Yeah, it works but when the player is going up into the left corner it's going reaallllllly slow.
Anyone knows how to solve this?


Reply With Quote
(Even when it's this late!)
