Drawing controls for Tetris in MFC

Started by
1 comment, last by Fresco 22 years, 4 months ago
Good day, 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 ? Thanks.
Advertisement
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.

---
Make it work.
Make it right.
Make it fast.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
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

SKeTch
SKeTch

This topic is closed to new replies.

Advertisement