From: Daniel Karbach Date: Fri, 5 Oct 2012 16:27:27 +0000 (+0200) Subject: added monster dummy X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=e6ba365d8f4b261687d4947d6b78f08c7fda1cdb;p=l2e.git added monster dummy --- diff --git a/src/main.cpp b/src/main.cpp index d92e294..c1b70af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -364,6 +364,14 @@ int main(int argc, char **argv) { mapDekar.SpriteOffset() = Vector(0, -32); mapGuy.AddFollower(&mapDekar); + SDL_Surface *mapMonsterImg(IMG_Load("test-data/monster-map.png")); + Sprite mapMonsterSprite(mapMonsterImg, 32, 32); + SimpleAnimation mapMonsterAnimation(&mapMonsterSprite, 500, 2, 0, 0, true); + Entity mapMonster; + mapMonster.SetAnimation(&mapMonsterAnimation); + mapMonster.Position() = Vector(64, 32); + mapMonster.SetOrientation(Entity::ORIENTATION_SOUTH); + InitScreen screen(width, height); app::State *state(0); @@ -381,12 +389,18 @@ int main(int argc, char **argv) { state = battleState; } else { MapState *mapState(new MapState(&map)); + mapState->AddEntity(&mapMaxim); mapState->AddEntity(&mapSelan); mapState->AddEntity(&mapGuy); mapState->AddEntity(&mapDekar); + mapState->ControlEntity(&mapMaxim); mapState->SetWalkingSpeed(walkSpeed); + + mapState->AddEntity(&mapMonster); + mapMonster.StartAnimation(*mapState); + state = mapState; } diff --git a/test-data/monster-map.png b/test-data/monster-map.png new file mode 100644 index 0000000..dab3123 Binary files /dev/null and b/test-data/monster-map.png differ