Display areas???

Started by
1 comment, last by Noods 22 years, 2 months ago
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
Advertisement
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.
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
like:
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...

This topic is closed to new replies.

Advertisement