From 5f53889d4357d8dba6e726ed38358eca96dbeb47 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Mon, 7 Oct 2019 18:35:47 -0400 Subject: Added ability to change rendering offsets and sizes --- Scripts/init.lua | 16 ++++++++-------- src/components/Component.hpp | 2 ++ src/components/Position.hpp | 9 +++++++-- src/components/Render.hpp | 19 +++++++++++++++++++ src/components/Velocity.hpp | 21 ++++++++++----------- src/physics.cpp | 4 ++-- src/render.cpp | 19 +++++++++---------- src/script.cpp | 4 ++-- src/texture.cpp | 22 +++++++--------------- 9 files changed, 66 insertions(+), 50 deletions(-) diff --git a/Scripts/init.lua b/Scripts/init.lua index 34e464b..46fe040 100644 --- a/Scripts/init.lua +++ b/Scripts/init.lua @@ -34,24 +34,24 @@ player = { x = 0.0, y = 0.0 }, - Hitbox = { - bounds = { + Physics = { + gravity = true, + hitbox = { {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", Render = { texture = "Assets/player.png", 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}, + 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 = { diff --git a/src/components/Component.hpp b/src/components/Component.hpp index 538d42b..5b0e3af 100644 --- a/src/components/Component.hpp +++ b/src/components/Component.hpp @@ -24,6 +24,8 @@ #include #include +#include + #include