SAF SAF is a [1]LRS [2]C [3]library for small, very [4]portable [5]games (and possibly other kinds pf programs); it can also be seen as a [6]fantasy console. It was made by [7]drummyfish. The repository is available e.g. at https://codeberg.org/drummyfish/SAF. [8]MicroTD is an example of a LRS game made with SAF, but even more complex games such as [9]Anarch have been ported to it. The whole SAF library is implemented in a [10]single header file (currently a bit under 5000 [11]lines of code, which is mostly due to including all the [12]boilerplate for all possible platforms it supports, the actual SAF logic is pretty small) and offers a simple [13]API for programming games, i.e. functions for drawing pixels to the screen, playing sounds, reading buttons, computing the [14]sine function etc., and it handles boring/annoying issues such as the game main loop. It also has built-in a number of [15]frontends that allow compiling a correctly made SAF games to any supported platform among which are [16]SDL, [17]SFML, [18]X11, [19]ncurses (terminal), even [20]open consoles such as [21]Pokitto, [22]Arduboy or [23]Gamebuino META. There is an option to auto-convert a color game to black-and-white only displays. Some PC frontends add emulator-like features such as time manipulation, [24]pixelart upscaling, [25]TAS support and so on. Games made with SAF run in 64x64 resolution, with 256 colors ([26]332 palette) and 25 [27]FPS. They can use 7 input buttons (arrows, A, B and C), play 4 different sound effects and use 32 [28]bytes of persistent memory, e.g. for savegames or highscores. These relatively low specifications are set on purpose so as to help [29]portability, reduce [30]bloat, frustration and [31]friction. Many times good, entertaining games can be very simple, as is the case e.g. with [32]Tetris, [33]chess, various [34]shmups, [35]roguelikes and so on -- these are the kinds of games SAF is ideal for. [] [][][][][] [][][] [][] [][] [] [] XX XX[] [] XXXX [] [][] [] [][][] [][] [] [][][][][] SAF logo microTD ________________________________________________________________ |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;' ';; ' ' ;;'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,, ,, | | ;''; ;,; ;,; ; | | ' ' ' ' ' ''' | |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| |;';;;;;;'';;;;;;;;;;';;;;;;;;;;;;;;;;''';;;;;;;;;;;;;;;;;;;;;;;;| |; ,';;; ',,;;; ,;;;, ,;;;;,;;;;;;;;;;,, ;;;;;;;;;;;;;;;;;;;;;;;;| |;,,;;;;;,,;;;,,;;;;;,,;;;;,;;;;;;;;;;,,,;;;;;;;;;;;;;;;;;;;;;;;;| ---------------------------------------------------------------- screenshot of a SAF game ([36]uTD) running in terminal with [37]ncurses See Also * [38]uxn Links: 1. lrs.md 2. c.md 3. library.md 4. portability.md 5. game.md 6. fantasy_console.md 7. drummyfish.md 8. utd.md 9. anarch.md 10. single_header.md 11. loc.md 12. boilerplate.md 13. api.md 14. sin.md 15. frontend.md 16. sdl.md 17. sfml.md 18. x11.md 19. ncurses.md 20. open_console.md 21. pokitto.md 22. arduboy.md 23. gamebuino.md 24. pixelart_upscale.md 25. tas.md 26. rgb332.md 27. fps.md 28. byte.md 29. portability.md 30. bloat.md 31. friction.md 32. tetris.md 33. chess.md 34. shmup.md 35. roguelike.md 36. utd.md 37. ncurses.md 38. uxn.md