https://github.com/superzazu/smgf
A small framework to make crossplatform (web, macOS, Linux, Windows) 2D games in Lua.
https://github.com/superzazu/smgf
2d 2d-game-engine framework game lua
Last synced: 10 months ago
JSON representation
A small framework to make crossplatform (web, macOS, Linux, Windows) 2D games in Lua.
- Host: GitHub
- URL: https://github.com/superzazu/smgf
- Owner: superzazu
- License: zlib
- Created: 2024-02-24T15:04:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T14:40:23.000Z (almost 2 years ago)
- Last Synced: 2025-02-11T18:09:45.216Z (12 months ago)
- Topics: 2d, 2d-game-engine, framework, game, lua
- Language: C
- Homepage: https://superzazu.github.io/SMGF/
- Size: 1.35 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMGF
SMGF is a small framework to make 2D games in Lua for the web, macOS,
Linux and Windows.
Features:
- minimal Lua (5.4) API, with exports for the web, macOS, Linux and Windows
- LSP annotations available for the whole API
- a simple hardware-accelerated 2D API powered by the SDL2
- streamed and static audio sources from multiple sound formats (ogg and wav by default, others formats such as mp3, flac, and tracker formats can be configured on build)
- inputs from mouse, keyboard and game controllers
- sandboxed IO environment to save/load data on the player computer, which
allows for game modding out of the box
- open source under the zlib license, which means you can use it and
distribute your games freely and free of charge
[Get started here!](https://superzazu.github.io/SMGF/docs/getting-started/)
## examples
Display an image on screen:
```lua
function smgf.init()
my_texture = smgf.graphics.new("my_image.png")
end
function smgf.draw()
smgf.graphics.clear()
smgf.graphics.draw(my_texture, 5, 5)
end
```
Play a sound on key press:
```lua
function smgf.init()
sound = smgf.audio.new("sfx.wav")
end
function smgf.key_down(key)
if key == "return" then
sound:play()
end
end
```