I''m trying to program Tetris with Visual C++ MFC. I already have java version of the game and I understand the game algoritm. The problem is that I''m new to C and I don''t know what dialog control I should use for the drawing of the blocks. I would like to use bitmaps as "tiles" (my Java version used the "g.fillRectangle" method for the squares that form a Tetris-shape). Can somebody give me a hint on this ?
Don''t use dialogs to draw the blocks. Use the wizard to create an SDI app, then you can use the GDI API to draw lines or rectangles, or you can also use it too load bitmaps. If you are thinking of programming strickly games, you really don''t need MFC and would be better off learning the basic Win32 stuff and DirectX.
There shouldn''t be any problem if you decide to do it on a dialog, though. I did It''s the same process anyway. The difference lies with the input processing. In a SDI app you can use the OnKeyDown function to detect keystrokes fine. For some strange reason, the Dialog won''t detect some key down message such for the down arroy key. In this case, use CDialog:reTranslateMessage instead of OnKeyDown.
Well, I think there''s a problem using dialogs after all