Could someone review my HaCKeR source?

Started by
22 comments, last by MadButch 22 years, 4 months ago
Thanks for posting that ellaborate story! It was a good read and great info.

I''m kinda doing something like you said now.. but indeed a litle different.

My graphics class now has an array of Images. The header contains an enum with all the image IDs. I use an enum because it''s very easy to maintain.. like this:

enum ImageIDs
{ IMG_UNDEFINED = 0, // Initial image id
IMG_BACKGROUND,
IMG_BLOCK,

MAX_IMAGES // Nr of Images to load
}

The MAX_IMAGES is used to determine the length of the image array. IMG_UNDEFINED is the initial value for all images.

the image array is an object array.. like this:
CDDrawImage m_theDDrawImage[MAX_IMAGES];

To use IMG_BACKGROUND and IMG_BLOCK, I only have to initialize the DDrawImage in the array. Like this:
m_theDDrawImage[IMG_UNDEFINED].SetProperties("UNDEFINED.BMP", false, 0 );
m_theDDrawImage[IMG_BACKGROUND].SetProperties("BACKGROUND.BMP", false, 0 );
m_theDDrawImage[IMG_BLOCK].SetProperties("BLOCK.BMP", false, 0 );


The difference between your and my version is that yours handles memory better. Because all my image classes are always in memory. Which is ok for small games, but it will have to change for bigger projects. It would then indeed become a pointer array instead of an object array.

and it was indeed a huge pile of work to change my old code into this new format.. but I still think it was worth it
Check my games out at:http://www.GamePlayHeaven.com
Advertisement
Hugo here, from UniteK Michael,
just to tell ya Congrats for the finished engine and game.
You''re a game coder now.
Good luck on all you''re future projects, see u out there...

Hugo Ferreira
UniteK Future
"Concentrate, and you can see it. If you see it, then it is possible. If it is possible, you can Achieve it."
I havent looked at the code (bit busy wrestling with my own code), but lurve the game, kicks ass. Just thought I should let the peeps know it is indeed a bit more than the standard first-attempt-at-programming-tetris-clone.
Thanks for the nice comments

Check my games out at:http://www.GamePlayHeaven.com

This topic is closed to new replies.

Advertisement