aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.cpp
diff options
context:
space:
mode:
authorAndy <drumsetmonkey@gmail.com>2017-01-19 09:14:12 -0500
committerAndy <drumsetmonkey@gmail.com>2017-01-19 09:14:12 -0500
commit19a32074595a4a2797eaeb978f8bd302f736f6a6 (patch)
tree3a25ebaf1c84746a16a7595175da6029ef3feb15 /src/player.cpp
parentfbd59263b52a42f85453ae918f8d2ab5817bd470 (diff)
Limb animation actually works
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/player.cpp b/src/player.cpp
index e83616d..c0710cc 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -9,7 +9,8 @@
static const char *spriteXML =
"<Sprite> \
<frame> \
- <src limb='0' offset='0,0' size='19,15' drawOffset='0,0'>assets/cat.png</src> \
+ <src limb='0' offset='0,0' size='15,23' drawOffset='0,9'>assets/player/player.png</src> \
+ <src limb='1' offset='15,0' size='12,11' drawOffset='2,0'>assets/player/player.png</src>\
</frame> \
</Sprite>";
@@ -22,14 +23,12 @@ void PlayerSystem::create(void)
//player.assign<Physics>(-0.001f);
player.assign<Physics>(1);
player.assign<Visible>(-0.2f);
-
auto sprite = player.assign<Sprite>();
XMLDocument xmld;
xmld.Parse(spriteXML);
auto frame = developFrame(xmld.FirstChildElement("Sprite"));
if (frame.size() > 0)
sprite->sprite = frame.at(0);
-
vec2 dim = player.component<Sprite>().get()->getSpriteSize();
float cdat[2] = {dim.x, dim.y};
player.assign<Solid>(cdat[0], cdat[1]);