Sign in to follow this  

Roguelike Development (Position cursor, clear screen)

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

Hi all, I am working on the bare basics of a rougelike...which library or ways can I use to achieve the clearing of screen and position of cursor? Thanks in advance!

Share this post


Link to post
Share on other sites

I'm working on a roguelike myself at the moment. The way I'm handling is to use OpenGL for the ascii 'graphics'. I simply use a texture with an image of all the available characters, and draw the ones I want at the specified positions. Its fairly easy to put together, if you've got some OpenGL knowledge. I've also heard of other people using SDL, and Pygame (which is basically a thin Python layer over SDL), and it seems to work well.

Share this post


Link to post
Share on other sites
If we are talking Windows, have a look to see if your compiler has an include called <conio.h>. That should contain everything you need.

If it doesn't support these operations then Borland's free BCC55 has a pretty good <conio.h> with the functions you need, or the free digital mars compiler has a library under <disp.h> which is very friendly for this sort of thing.

Failing that, any Windows compiler will support the Win32 API console functions which, while more complex, will provide very precise control over the console screen output.

HTH Paul

Share this post


Link to post
Share on other sites
Quote:
Original post by EasilyConfused
If we are talking Windows, have a look to see if your compiler has an include called <conio.h>. That should contain everything you need.

If it doesn't support these operations then Borland's free BCC55 has a pretty good <conio.h> with the functions you need, or the free digital mars compiler has a library under <disp.h> which is very friendly for this sort of thing.

Failing that, any Windows compiler will support the Win32 API console functions which, while more complex, will provide very precise control over the console screen output.

HTH Paul


Thanks for the tip, but would the program be cross-platform afterwards?

Share this post


Link to post
Share on other sites
Quote:
Original post by Extrakun
Thanks for the tip, but would the program be cross-platform afterwards?

Probably not. Win32 APIs only work on Win32 systems.

Share this post


Link to post
Share on other sites
Quote:
Original post by Extrakun
Quote:
Original post by EasilyConfused
If we are talking Windows, have a look to see if your compiler has an include called <conio.h>. That should contain everything you need.

If it doesn't support these operations then Borland's free BCC55 has a pretty good <conio.h> with the functions you need, or the free digital mars compiler has a library under <disp.h> which is very friendly for this sort of thing.

Failing that, any Windows compiler will support the Win32 API console functions which, while more complex, will provide very precise control over the console screen output.

HTH Paul


Thanks for the tip, but would the program be cross-platform afterwards?


I've found conio.h supported with Linux compilers but the contents of conio.h vary from compiler to compiler, let alone platform to platform.

If you are looking for a cross-platform solution to platform-dependant features, you'll have to look into a third party library of some kind. I'm sure one must exist for console manipulation although I've not come across one myself.

Apparently the PDCurses one Will F mentioned above supports DOS, Windows, OS/2 and X11.

Share this post


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