5
FBDev64
12d

Airlib is a library for Terminal gamedev.

Project Type
Existing open source project
Summary

Airlib is a library for Terminal gamedev.

Tech Stack
C
Current Team Size
1
URL
Comments
  • 1
    Wish 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!
  • 1
    Why isn't clrscr PascalCase like the rest? That's discrimination 😮
  • 1
    I 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
  • 1
    @retoor Thanks really
  • 1
    @retoor cuz I overthinked about crossplatform and this command was a problem until I found this solutiojn.
  • 0
    @FBDev64 ah yes. You could wrap it with #ifdef _WIN32 so at least on linux it works fast and slow method for windows
  • 1
    @retoor 🤣
Add Comment