diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-06-28 21:32:04 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-06-28 21:32:04 -0400 |
commit | a466eb8fd6e5707aaa1bfafa28535b82c67d69d8 (patch) | |
tree | ce3a09b7b98584b3d42351eae7fd7e183e38b7f8 /src/mob.cpp | |
parent | 00f633afb62ed6914205639b44dcdaf839a2c2f7 (diff) |
chests?, custom controls
Diffstat (limited to 'src/mob.cpp')
-rw-r--r-- | src/mob.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
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; |