Archived

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

Noods

Display areas???

Recommended Posts

Noods    205
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
DaJoostMan    122
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
Lohrno    222
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...

Share this post


Link to post
Share on other sites