superzazu / SMGF

A small framework to make crossplatform (web, macOS, Linux, Windows) 2D games in Lua.

Home Page:https://superzazu.github.io/SMGF/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

examples

Display an image on screen:

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:

function smgf.init()
  sound = smgf.audio.new("sfx.wav")
end

function smgf.key_down(key)
  if key == "return" then
    sound:play()
  end
end

About

A small framework to make crossplatform (web, macOS, Linux, Windows) 2D games in Lua.

https://superzazu.github.io/SMGF/

License:zlib License


Languages

Language:C 51.0%Language:Lua 38.9%Language:TypeScript 5.6%Language:CMake 3.5%Language:CSS 1.0%Language:JavaScript 0.0%