]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
removed some outdated TODOs
[l2e.git] / src / main.cpp
index 987a985cc74083e76a29953a357b490ea12947fe..8325163ef61c435ec662e2d0e0c8f96c74cbe018 100644 (file)
@@ -89,15 +89,24 @@ int main(int argc, char **argv) {
                heroesLayout.AddPosition(Point<Uint8>(160, 152));
 
                SDL_Surface *monsterImg(IMG_Load("test-data/monster.png"));
-               Sprite dummySprite(monsterImg, 64, 64);
+               Sprite monsterSprite(monsterImg, 64, 64);
                Monster monster;
                monster.SetName("Lizard");
-               monster.SetSprite(&dummySprite);
+               monster.SetSprite(&monsterSprite);
                monster.SetLevel(1);
                monster.SetMaxHealth(8);
                monster.SetHealth(8);
                monster.SetStats(Stats(14, 6, 6, 6, 6, 6, 6));
                monster.SetReward(3, 5);
+               ComplexAnimation monsterAttackAnimation(&monsterSprite, 4 * framerate);
+               monsterAttackAnimation.AddFrame(0, 1, Vector<int>(16, 0));
+               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);
@@ -346,9 +355,7 @@ int main(int argc, char **argv) {
                Sprite magicTargetCursor(targetingIconsImg, 32, 32, 0, 32);
                Sprite itemTargetCursor(targetingIconsImg, 32, 32, 0, 64);
                battleRes.weaponTargetCursor = &weaponTargetCursor;
-               // TODO: add image for magic targeting cursor
                battleRes.magicTargetCursor = &magicTargetCursor;
-               // TODO: add image for item targeting cursor
                battleRes.itemTargetCursor = &itemTargetCursor;
 
                Spell resetSpell;