9 downloads 120 views 0 likes Aug 5, 2024
Obsi 2 (Lua Library For GameDev) by Sima :3
Obsi 2 - Lua library for 2D game development.
Obsi 2 is a Lua library that was designed specifically for CC:Tweaked. Originally it was made as a game engine, but I have refactored it into a library for easier packaging.
Improvements in Obsi 2:
- More optimized
obsi.graphics.rectangle
function - New
obsi.graphics.getPalette
function! (Yes, it didn't exist before. Also be aware that it creates a new table on every call. Sorry.) - FPS counter that is accessible with
obsi.timer.getFPS()
- Module
obsi.filesystem
was renamed toobsi.fs
, and moduleobsi.time
toobsi.timer
- Rendering APIs
hmon
andparea
were renamed tobasic
andneat
- File extensions are mostly ignored (This is useful for when you have a system for converting
nfp
files toorli
files, but don't want to bother with renaming every file in code) - Fixed a crash when the game would play noteblock music in Minecraft
- Licenses from used projects are moved to
LICENSES
folder - Some other changes that I forgot about
Switching from Obsi to Obsi 2:
There are a few things to look out for when switching to Obsi 2:
- Now you have to include
obsi2
as a library - In order for your code to be ran in the loop, you have to put
obsi.init()
at the end of your main file - Replace any mentions of
obsi.filesystem
withobsi.fs
andobsi.time
withobsi.timer
- Move the code from
config.lua
file (it is no longer used by obsi) to the config insideobsi2/init.lua
- Replace any mentions of
hmon
andparea
rendering apis tobasic
andneat
respectively - If the code outside of your
main.lua
file is also usingobsi
, then require it there as well. (Don't worry,require
caches any of the packages it loads.)
comments
You can login with Discord to leave comments and reply to others!
There are no comments yet