Hello Jakoe!
OK, I think I have fixed your problem. I did add the clsTetDisplay class, and edited the Splash sub to use the clsTetDisplay class' ClearScreen method. Why?
Well, we are dealing with more than one Graphics object here, we are dealing with the Preview Window, the Main Game Window, the Splash Screen window, as well as the In memory image - which is buffered. The ClearScreen method ensure that an in meory graphic exists, then "paints it black" - like the Rolling Stones song - Paint It Black ;)
Here is what it looks like :
Code:
''' <summary>
''' Determine Existance Of In Memory Graphic
''' </summary>
''' <returns></returns>
''' <remarks></remarks>
Public Function ValidGraphic() As Boolean
If Not (g Is Nothing) And Not (InMemoryGraphics Is Nothing) Then
Return True 'If There Is A Graphic In Memory
Else
Return False 'If Not
End If
End Function
''' <summary>
''' Erase Game Screen
''' </summary>
''' <remarks></remarks>
Public Sub ClearScreen()
'If No Valid Graphic, Do Nothing
If Not ValidGraphic() Then
Return
End If
'Create A Solid Black Brush
Dim ClearBrush As New SolidBrush(Color.Black)
'Fill The Rectangle With The Black Colour, Causing The Clearance of The Images
InMemoryGraphics.FillRectangle(ClearBrush, 0, 0, ScreenWidth, ScreenHeight)
End Sub
This is necessary, as we clear the in memory graphic at the end of the day.
I also added the Setup method to frmTet, and called it from the Form's constructor - frmTet.Designer.vb
The Setup method takes care of loading and initialising all the necessary class objects, for use.
I decided to take this route with my program, as it is much more organised, and cleaner. Grid code is separate, shape code is separate, Display code is separate, game code is separate.
I am attching your project here, and please let me know what the results are.
here is the link to part 3 BTW :
http://www.codeguru.com/vb/gen/vb_mi...cle.php/c17081