From a466eb8fd6e5707aaa1bfafa28535b82c67d69d8 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 28 Jun 2016 21:32:04 -0400 Subject: chests?, custom controls --- src/mob.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/mob.cpp') diff --git a/src/mob.cpp b/src/mob.cpp index eba970e..20273d6 100644 --- a/src/mob.cpp +++ b/src/mob.cpp @@ -424,6 +424,48 @@ void Trigger::createFromXML(XMLElement *e, World *w=nullptr) void Trigger::saveToXML(void) {} +Chest::Chest(void) : Mob() +{ + ridable = false; + aggressive = false; + maxHealth = health = 100; + width = HLINES(10); + height = HLINES(5); + tex = TextureIterator({"assets/chest.png"}); +} + +void Chest::act(void) +{ + //die(); +} + +void Chest::onHit(unsigned int _health) +{ + (void)_health; + die(); +} + +bool Chest::bindTex(void) +{ + glActiveTexture(GL_TEXTURE0); + tex(0); + return true; +} + +void Chest::createFromXML(XMLElement *e, World *w) +{ + (void)w; + loc = vec2 { 0, 100 }; + xmle = e; +} + +void Chest::saveToXML(void) +{ + xmle->SetAttribute("alive", alive); +} + + + Mob::~Mob() { delete inv; -- cgit v1.2.3