-
February 5th, 2004, 10:49 AM
#1
PCMAN programming
PC-MAN
I am planning to program the exact classic version of PC-MAN in c++ (the classic version occupies only 17KB! which is a .com file) which i suppose made in 320x200 in 16 colour.
I want to program this game in 320x200 in 16 colours DOS Mode. Now;
1. How can i initialise this mode (ie. 300x200 in 16 colour) using the initgraph function in c++. please tell me how?
2. Can i use getimage() / putimage() to capture my pc-man image defined in unsigned char[] array for animation. if yes, how? if no, why?
3. In case if I use the double buffering technique, how can i use getimage() / putimage() for animation.
I have already programmed a small part this game (i.e. movement of enemy in all the direction) using the image stored in unsigned char[] array under double buffering technique. But here i have to draw the background (i.e. path/maze) alongwith all animations every time, otherwise the movement of opponent would erase the background .
For this particular reason i want to program the graphics using getimage() / putimage(). I want to draw the maze only once and then the animation follows. also please advise me which is the best way to program this game. i.e. normal onscreen mode or double buffering mode.
i would like to add that i really appreciate the classic version of PC-MAN since this game occupies only 17KB! which is really unbelievable!!. How this program has been made. In assembly or in C++. I used to play this game a lot in my school time and now i want to program this my own. Kindly help.
your help would be highly appreciated.
thanks
-
February 5th, 2004, 10:31 PM
#2
Not sure about your questions, but just fyi, your game won't be 17kb with C++. Just using main() will make it take up like 20kb or something like that. It can still be well under 100kb, but don't expect it to be 17kb. Also, I would bet the classic game was made in either assembly, C or maybe some other older language, but I doubt it was C++.
-
February 6th, 2004, 06:00 PM
#3
As I remember, if you do DOS programming, you should:
1. Keep yourself away from "initgraph".
Use 0xa000 video-card address instead.
And int 10h to switch graphic mode.
2. Compile with "tiny" option of compiler.
This will create you ".com" executable and not ".exe".
3. Keep your data, code and stack segment size in 64K boundary.
I mean avoid huge allocations and too deep recursions.
If you follow this notation, you will get your 17K or with
some effort even less.
The only question is why DOS ?
What is wrong with somewhat bigger app for Win32 ?
Or may be XLib ?
Or Swing from Java ?
-
February 7th, 2004, 01:45 PM
#4
I think you should really evaluate whether you want to write a DOS program. If the only reason to use DOS is size, then there are other possibilities. Size is not a significant consideration for desktop systems and most laptops; it might be a consideration for PDA type systems, but even then, as far as I know, 100 KB is not a problem. I think any system in which size would be a significant consideration is not likely to be running DOS.
Also, it helps to be clear about what you are asking about. The C++ langauge does not have an initgraph function, so I assume it is something provided by the compiler you are using.
-
February 13th, 2004, 12:45 PM
#5
Info for kasracer: It`s Windows application that takes
100K for empty main. DOS application, even .exe takes less.
Answer to Sam: initgraph as well as line, plot etc. are
coming with Borland C++ BGI library (pretty havy as for DOS).
Because Borland compilers were most popular for DOS, it was
easy to get confused about.
In any case choosing DOS it seems good only for training.
But it shouldn`t be better if you can show your program
to somebody that can`t appreciate your educational
efforts in DOS ?
-
February 13th, 2004, 12:46 PM
#6
Originally posted by arkadi
Info for kasracer: It`s Windows application that takes
100K for empty main. DOS application, even .exe takes less.
I know, I said it can still be well under 100kb.
-
February 19th, 2004, 02:48 PM
#7
Four years ago I played Java versions of Space Invaders and Asteroids, and they looked better, and played just as well as, anything in an arcade 20 years ago.
Go for Java and then you can dump it on the net, until the guys who own the rights come after you, of course.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|