From: Clyne Sullivan Date: Tue, 15 Nov 2022 12:35:07 +0000 (-0500) Subject: merge branch lib-cleanup into ui X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=a056c15dd3781b4f6bb89fdd738b14cafc00cd85;p=clyne%2Fgamedev2.git merge branch lib-cleanup into ui --- a056c15dd3781b4f6bb89fdd738b14cafc00cd85 diff --cc Makefile index e1827a7,a14fb2b..4ec54da --- a/Makefile +++ b/Makefile @@@ -82,7 -88,18 +88,19 @@@ $(OUTDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SR @sed -e 's/.*://' -e 's/\\$$//' < $(OUTDIR)/$*.$(DEPEXT).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(OUTDIR)/$*.$(DEPEXT) @rm -f $(OUTDIR)/$*.$(DEPEXT).tmp - mem: $(EXEC) - valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./$(EXEC) + lib/libentityx.a: + @cmake -S lib/entityx -B lib/entityx -DENTITYX_BUILD_SHARED=FALSE + @make -Clib/entityx -j4 entityx + @cp lib/entityx/libentityx.a lib/libentityx.a + + lib/libluajit.a: + @make -Clib/luajit -j4 + @cp lib/luajit/src/libluajit.a lib/libluajit.a + + lib/libsoil.a: + @make -Clib/soil -j4 + @cp lib/soil/libsoil.a lib/libsoil.a + + .PHONY: all remake clean cleaner cleanall resources +.PHONY: all remake clean cleaner resources mem diff --cc Scripts/init.lua index 80fee32,66fbcb1..60f21c6 --- a/Scripts/init.lua +++ b/Scripts/init.lua @@@ -38,24 -36,16 +39,29 @@@ player = x = 0.0, y = 0.0 }, - Physics = 0, + Physics = { + hitbox = { + ll = {x = -0.5, y = -0.8}, + lr = {x = 0.5, y = -0.8}, + ul = {x = -0.5, y = 0.8}, + ur = {x = 0.5, y = 0.8}, + } + }, Name = "bord", + Audio = { + file = "Assets/jump.wav" + }, + hellotrue = true, + hellofalse = false, Render = { texture = "Assets/player.png", - visible = true + visible = true, + offset = { + ll = {x = -0.5, y = -0.8}, + lr = {x = 0.5, y = -0.8}, + ul = {x = -0.5, y = 0.8}, + ur = {x = 0.5, y = 0.8}, + } }, Light = { r = 1.0, diff --cc src/script.cpp index 4fda543,9fae1c9..b1d82e9 --- a/src/script.cpp +++ b/src/script.cpp @@@ -120,9 -120,12 +121,13 @@@ void ScriptSystem::scriptExport(void lua.new_usertype("Physics", sol::constructors(), - "standing", &Physics::standing); + "standing", &Physics::standing, + "gravity", &Physics::gravity); + lua.new_usertype