Jump to content
  • Advertisement
Sign in to follow this  
vrok137

[C++] Creating a console version of worm

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

Here I go again, I recently saw a text-based version of worm running in UNIX shell. Frankly I was impressed, and out of sheer curiosity, would like to implement a similar version in C++. But research has indicated that there is a certain library called ncurses that might allow a programmer to implement text-based animation of said game. The only problem is there are few stable/incomplete ports of ncurses for Windows. So is there any method, library, or other way where I can re-create a fully functional version of worm on a text-based console? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You could use pdcurses , but it's not that hard to use WriteConsoleOutput() (and related functions) to manipulate a console buffer yourself.

Share this post


Link to post
Share on other sites
PDCurses is quite stable. I know a number of rogue likes have windows ports that use it (like Adom). It should do everything you need.

Share this post


Link to post
Share on other sites
Thanks for the help, if I may though I have one more question. in making this text-based version of worm, I need to simulate animation. Currently I am experimenting with creating some functions to do this for me, while still leaving the option of pdcurses in mind.

My implementation of animation in the console window consists of using
system("cls"). I later found this technique to be very poor, as the animation was not smooth but very "flickery" and choppy. I guess because every time a frame would update, the whole screen would have to be recleared and everything redrawn.

My question is that before I switch to a library like pdcurses, are there any functions defined elsewhere that allow for smoother animation in the console window (or at least as to where only the needed parts of the screen are cleared while the rest of the buffer remains intact)? Thanks once again.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
t's not that hard to use WriteConsoleOutput() (and related functions) to manipulate a console buffer yourself.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!