From 1b63e00b6b08133f5ee37ed90043eee0f67942fd Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Mon, 7 Oct 2019 17:39:52 -0400 Subject: [PATCH] Added script conversion code, can now convert table to vec2, vec3 and vec4 --- Assets/world/world1/layers/0/hitbox.png | Bin 4795 -> 4782 bytes Makefile | 2 +- Scripts/init.lua | 28 +++--- src/components/Component.hpp | 2 + src/components/Position.hpp | 13 +-- src/script.cpp | 2 +- src/script/vectors.cpp | 108 ++++++++++++++++++++++++ src/script/vectors.hpp | 31 +++++++ src/world.cpp | 1 - src/world.hpp | 12 +-- 10 files changed, 170 insertions(+), 29 deletions(-) create mode 100644 src/script/vectors.cpp create mode 100644 src/script/vectors.hpp diff --git a/Assets/world/world1/layers/0/hitbox.png b/Assets/world/world1/layers/0/hitbox.png index 881b13ea81b9e4239995238f3a6c402bb327ba98..9ae9622a4111e0845d4b2e8f6c7f71d873d638a8 100644 GIT binary patch literal 4782 zcmeH~`9GBF8^`aNG4`>SHA~h|(WDS&WJ_gkYwjn}+|&rgF2W7~ zKpCIYw*Y_@YQg|3GxQ^m$(jNHz87}cCcxrquq46X*A0K&RWcxy;40}Ff_DQT_nnq{oL6PMy_B%u*Q z*^*rKrmcF2^3`*;H*=S4NlticIP9f)YY5g1D$yhSs15MzKv^CswBH*W<^L*6D`>U#lA0kTR01ab@?Nvuj|lXz&lN zomo?u=Mte3j-yf3=BeU70%rBpJi+o+qt!H`XuG@Mweez%4$gt@sO%o~oo=Ed(~OiF zS^w;tyx>9_ocDZP>pzxVUtW8q|BPGJhq7cJRTh~-7u9gx;7kL(V}A`zMvqZ=5W{5s zJVlh|;0UF)qg_5m8eKzucAHBm_S1_zw@0naOAcbj{po!0Bbes?6Tf8D8H$G|;Qj&bG*trKq2XC)62746-PZxX>{|M75)pw zSv}n`2TG6S+iN$}g@3cFWgV-xGf(TdaHRT$M@QFz1|A z164C_J-^_qZ)B%xF4X<9<`|~^RbMgh>j1hSXw$Y=Gu>0qP(<_l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m1+z8FWt$s>l{y&PLsG-VbgIn)b3qdubrGNcB^DRsq8_=qoI((gw#tM zW>-ZG^cjq<;Uv!7w@6QteBYe=P&)hgRE+9SKAHP1GmZdd)NpBBqbeq5QMKqmik5$0 z57eR%E@sAtKpWTs-r$odt`K1&nAimYpddjzVBvRkLm|i*Y-(=AxWLSKRG!C9@=OSX z_=AnG!5DvEUpK#CfC+TF80_XM8s-%YW!===>U{hWUZ^Fem>TMz3!i*HZ5AkD%bxr! zm%Uo7hEBXdiEihK5RW)QmELc?;ceth^$34haPW=Q#o<2>#Vl{Eo!@=)YIaH*3PUrT z$!zTI_n5u8KGMPV@t^GX=igBQ?CV~ru4smCj-s#oI>7>3nt|Yg2Ie{W z9=h9|hL`R#B#S|w06Z9;=LA#3R7Y5Lk=WeeO>I30;!fn3>LuyOZg`Hfc_6HeQ>cP8 zU!oc|m#(+aog?#a8V^TNjFnI4UnAGToIZQaTaG> zLx(p29y?C6F%h3e;ecSV<0G$@Kqv`Xy#O>Oj@{n8WC8=&d|^RAte>d8s1Sf|hl93A zre-jPgn^;*N(8_u?syki7nzZCfue#KFH8Ws$-Wg53}}ddQyY?BLT97Hz(ISWBQqcL zHniOf9j_a2dV7*|Na~>4$v^?gDg`L~%Tdq>xo;;`P{k@sK?v%!S-)F+89g9BTc86J zvmIY|(Wg58XlGE;lISSJ_a`9cta!ixHDJegQS7OP2igIkqnVlwm1+Qxc=iMu6TO3X zmjI%ZZ@rGvpmBvW10a5Weg9@2AYy|mttn8dgwhVU0BCR{xjWGTgUsS&ST_r(QP+_H zV0}<{c!(Yt7HVa}5qtoL+OvYhpBs7 zYyGbwe?v%#--7%ohu_6Oli_bu48%3XCkN|LKl@=6O6<4q*(-`|g== 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