Jump to content

  • Log In with Google      Sign In   
  • Create Account


Drawing controls for Tetris in MFC


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Fresco   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 December 2001 - 01:26 AM

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.

Sponsor:

#2 CaptainJester   Members   -  Reputation: 523

Like
Likes
Like

Posted 14 December 2001 - 01:58 AM

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.

#3 SketchTurner   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 December 2001 - 10:42 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS