]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
added melee animation of monsters
[l2e.git] / src / main.cpp
index f7707ef1cc0570053097d7e18a8271e23c921dba..14a6336f014df0d2028d3124f2699ca9a2af64b1 100644 (file)
@@ -103,6 +103,10 @@ int main(int argc, char **argv) {
                monsterAttackAnimation.AddFrame(0, 0, Vector<int>(16, 0));
                monsterAttackAnimation.AddFrame(0, 1, Vector<int>(16, 0));
                monster.SetAttackAnimation(&monsterAttackAnimation);
+               SDL_Surface *monsterMeleeImg(IMG_Load("test-data/attack-monster.png"));
+               Sprite monsterMeleeSprite(monsterMeleeImg, 96, 64);
+               SimpleAnimation monsterMeleeAnimation(&monsterMeleeSprite, framerate, 14);
+               monster.SetMeleeAnimation(&monsterMeleeAnimation);
 
                SDL_Surface *maximImg(IMG_Load("test-data/maxim.png"));
                Sprite maximSprite(maximImg, 64, 64);