Jump to content
  • Advertisement

Archived

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

Shazer

Clueless Newbie

This topic is 6533 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

I am sorry to say that I am, in fact, a rather clueless newbie... I am having trouble designing the graphics engine for my first graphical game. It is a tetris clone. I don''t really know what needs to go in it or how to implement it. Please, don''t just give me one to use. I would like some hints and pointers or general outlines to help me. Doing is the key to learning. Thanx a bunch!! (I need to know how I should arrange my sprite surfaces, how I should keep track of blocks and how to make it so the space around them is "not there"). You may think this makes me sound stupid, and I very much agree with you... Please, help! I would appreciate it!

Share this post


Link to post
Share on other sites
Advertisement
Wow, I finally get to help someone

I''m not sure myself, but believe that you would use DirectDraw...a BIG step from the text based stuff you''ve probably been doing (I''ll find out myself as soon as I can get my book )

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
keep track of blocks in an array thats as simple as you can get. a 2 dimensional array at that. should be 10x20. Make the array a char or int, it doesnt matter. If you had had a char array, for instance, you could assign a ''b'' char in a cell, and the code would be able to go through the array, and when it got to the ''b'', it would know to draw a blue block there. You see what i''m getting at? So going through the loop is simple, whenever you go through an array , just see what char is stored there on each loop, and draw the appropriate block. Figuring out where to draw the graphic is game specific, depends on your graphic size, playing field size, etc.

char array[10][20]; or something like that, 10 cols, 20 rows,

for (int i = 0; i <=20; i++)
for (int j = 0; j <= 10; j++)
if (array[j] == ''b'')
draw blue box
if (array[j][i] == ''y'')
draw yellow box.......you get the idea



Share this post


Link to post
Share on other sites
Hey, thanks! That helps a lot. I never knew you could make 2d arrays. Although it is a useful concept...



"Early to bed and early to rise, makes a man stupid and blind in the eyes." -Mazer Rackham, Ender's Game

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!