Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
retoor981613dWish I could help a bit, and very maybe will do under anonymous gh account but here smol review:
- for * char that doesn't get mutated use const char * instead (. E.g. arguments)
- clrscr is very slow (too slow) to do a regresh every frame. There's an ansii code for that, thousand times faster. Like the way you do your colors
- \033 / \x1b / \x1B / are the same. \e also. It means escape. I would replace all prefixes with \e. I think C doesn't like \033. Do you compile with -Wall -Werror?
- use unsigned int instead of int if value shouldn't be negative
But nice stuff! Good luck! -
retoor981613dI made an terminal multi-player "game" a while ago with 500 bots active. Server could handle easily. State of game was at server and bots just said the direction they want to go.
Also, think about rendering, one whole string goes way faster than many times printf / putchar. Probably you need store buffer somewhere and make custom printf or putchar function or smth. Custom flush to print and reset buffer to zero. But maybe you've better idea -
FBDev64838d@retoor cuz I overthinked about crossplatform and this command was a problem until I found this solutiojn.
-
retoor98168d@FBDev64 ah yes. You could wrap it with #ifdef _WIN32 so at least on linux it works fast and slow method for windows
Airlib is a library for Terminal gamedev.
Airlib is a library for Terminal gamedev.