Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Display areas???

This topic is 5973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK I''m stuck. I dont know how you tell Windows where to display an image. Lets say I wanted to make Tetris. I create a background and leave the area where you manipulate the falling blocks a solid color. How do I tell Windows that I want to make that area the area that the blocks can travel in. Or how do I tell it where to display any image at all?!?! Noods

Share this post

Link to post
Share on other sites
u dont tell windows anything.
i assume u use directdraw?
u use the video buffer which is an array of screenwidth x screenheight so if u use 640x480 its length is 307200.
to acces a pixel at x,y u have to acces the video buffer at (640*x) + y.

read up in the tutorials in the ''for beginners'' section it''s all much better explained there.

Share this post

Link to post
Share on other sites
That''s a conceptual problem for ya!
Ok, you first have to have your box you put the blocks in...
like 100,100, to 150,400 or whatever
Then you need a very small amount of collision detection code
If (user presses left) then (check to see if block x coordinate
-(how ever far you are moving your block) is less than 100
if right, greater than 150...

I''m sure that was clear as mud, but...
but yeah, thats something you''ll have to program yourself...

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!