X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=beef2feba24a0a74497c282b4dcf112a1d832350;hb=6e88a625710c7936f87b38ecf6094472f3a49f4f;hp=8029a64c42d9ecb570c776990c562b1b56724203;hpb=0ad5ca97b5df217329bc319d62564a9f46ba11d7;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index 8029a64..beef2fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -417,6 +417,7 @@ int main(int argc, char **argv) { Trigger triggers1[1]; triggers1[0].SetTilePosition(Vector(8, 3)); + triggers1[0].SetType(Trigger::TYPE_NORTH); SDL_Surface *tilesetImg(IMG_Load("test-data/tileset.png")); Sprite tileset(tilesetImg, tileSize, tileSize); @@ -508,6 +509,7 @@ int main(int argc, char **argv) { Trigger triggers2[1]; triggers2[0].SetTilePosition(Vector(6, 2)); + triggers2[0].SetType(Trigger::TYPE_SOUTH); Map map2; map2.SetAreas(areas2, 1); @@ -536,16 +538,22 @@ int main(int argc, char **argv) { gameState.heroes[3].MapEntity().SetFlags(Entity::FLAG_NONBLOCKING); gameState.heroes[2].MapEntity().AddFollower(&gameState.heroes[3].MapEntity()); + Entity mapPopulation[2]; + map1.SetEntities(mapPopulation, 2); + 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); - mapMonster.SetPartyLayout(&monstersLayout); - mapMonster.SetMonsters(&monster, 1); - map1.SetEntities(&mapMonster, 1); + mapPopulation[0].SetAnimation(&mapMonsterAnimation); + mapPopulation[0].Position() = Vector(64, 32); + mapPopulation[0].SetOrientation(Entity::ORIENTATION_SOUTH); + mapPopulation[0].SetPartyLayout(&monstersLayout); + mapPopulation[0].SetMonsters(&monster, 1); + + Sprite blockSprite(tilesetImg, tileSize, tileSize, 3 * tileSize, 1 * tileSize); + mapPopulation[1].SetSprite(&blockSprite); + mapPopulation[1].Position() = Vector(64, 160); + mapPopulation[1].SetFlags(Entity::FLAG_PUSHABLE | Entity::FLAG_FIXED_ORIENTATION); InitScreen screen(width, height); @@ -567,7 +575,7 @@ int main(int argc, char **argv) { mapState->ControlEntity(&gameState.heroes[0].MapEntity()); mapState->SetWalkingSpeed(walkSpeed); - mapMonster.StartAnimation(*mapState); + mapPopulation[0].StartAnimation(*mapState); state = mapState; }