From: Andy Belle-Isle Date: Mon, 7 Oct 2019 21:39:52 +0000 (-0400) Subject: Added script conversion code, can now convert table to vec2, vec3 and vec4 X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=1b63e00b6b08133f5ee37ed90043eee0f67942fd;p=clyne%2Fgamedev2.git Added script conversion code, can now convert table to vec2, vec3 and vec4 --- diff --git a/Assets/world/world1/layers/0/hitbox.png b/Assets/world/world1/layers/0/hitbox.png index 881b13e..9ae9622 100644 Binary files a/Assets/world/world1/layers/0/hitbox.png and b/Assets/world/world1/layers/0/hitbox.png differ diff --git a/Makefile b/Makefile index e586110..9c9fafe 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ LIBS = -L$(LIBDIR) -lSDL2 -lpthread -lentityx -lluajit -ldl -lGLEW -lGL \ -lSDL2_image -lSOIL -lfreetype CXXFLAGS = -ggdb -std=c++17 -Wall -Wextra -Werror -pedantic \ - -Wno-class-memaccess -Wno-implicit-fallthrough -m64 + -Wno-class-memaccess -Wno-implicit-fallthrough -m64 -O1 CXXINCS = -Isrc -I$(LIBDIR)/LuaJIT/src -I$(LIBDIR)/entityx \ -I$(LIBDIR)/LuaBridge/Source -I$(LIBDIR)/sol2/include \ diff --git a/Scripts/init.lua b/Scripts/init.lua index 1693d0c..34e464b 100644 --- a/Scripts/init.lua +++ b/Scripts/init.lua @@ -28,20 +28,31 @@ player = { end }, Position = { - x = 15, - y = 75 + 15.0, 10.0 }, Velocity = { x = 0.0, y = 0.0 }, + Hitbox = { + bounds = { + {x = -0.5, y = -0.8}, + {x = 0.5, y = -0.8}, + {x = -0.5, y = 0.8}, + {x = 0.5, y = 0.8}, + } + }, Physics = 0, Name = "bord", - hellotrue = true, - hellofalse = false, Render = { texture = "Assets/player.png", - visible = true + visible = true, + bounds = { + {x = -0.5, y = -0.8}, + {x = 0.5, y = -0.8}, + {x = -0.5, y = 0.8}, + {x = 0.5, y = 0.8}, + } }, Light = { r = 1.0, @@ -50,11 +61,6 @@ player = { strength = 1.0 }, Idle = function(self) - --if (self.visibleTick >= 20) then - -- self.Render.visible = not self.Render.visible - -- self.visibleTick = 0 - --end - --self.visibleTick = self.visibleTick + 1 end, visibleTick = 0 } @@ -86,7 +92,7 @@ ball = { dofile("Scripts/world.lua") playerSpawn = game.spawn(player); ---game.spawn(ball); +game.spawn(ball); ------------------- -- SERIALIZING -- diff --git a/src/components/Component.hpp b/src/components/Component.hpp index 2928366..538d42b 100644 --- a/src/components/Component.hpp +++ b/src/components/Component.hpp @@ -24,6 +24,8 @@ #include #include +#include