]> git.localhorst.tv Git - l2e.git/commitdiff
added monster dummy
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 5 Oct 2012 16:27:27 +0000 (18:27 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 5 Oct 2012 16:27:27 +0000 (18:27 +0200)
src/main.cpp
test-data/monster-map.png [new file with mode: 0644]

index d92e2940cc1dcb8b7b97fb477a5c17fccb044339..c1b70af05f1dc492d717c17679a11150fe659285 100644 (file)
@@ -364,6 +364,14 @@ int main(int argc, char **argv) {
                mapDekar.SpriteOffset() = Vector<float>(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<float>(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 (file)
index 0000000..dab3123
Binary files /dev/null and b/test-data/monster-map.png differ