const int width = 800;
const int height = 480;
- const int tileSize = 32;
const float walkSpeed = 128.0f;
bool battle(false);
InitSDL sdl;
InitImage image(IMG_INIT_PNG);
+ Area::CreateTypeDescription();
battle::Resources::CreateTypeDescription();
ComplexAnimation::CreateTypeDescription();
Font::CreateTypeDescription();
Ikari::CreateTypeDescription();
Interpreter::CreateTypeDescriptions();
Item::CreateTypeDescription();
+ Map::CreateTypeDescription();
graphics::MenuProperties::CreateTypeDescription();
Monster::CreateTypeDescription();
PartyLayout::CreateTypeDescription();
Sprite::CreateTypeDescription();
Stats::CreateTypeDescription();
common::TargetingMode::CreateTypeDescription();
+ Tile::CreateTypeDescription();
+ Trigger::CreateTypeDescription();
Entity::CreateTypeDescription();
Arguments args;
Caster caster(intp);
+ {
+ Map *map1(caster.GetMap("map1"));
+ Map *map2(caster.GetMap("map2"));
+ std::cout << map1 << ' ' << map2 << std::endl;
+ }
+
GameState gameState;
gameState.heroes[0] = *caster.GetHero("maxim");
gameState.heroes[3].SetRing(caster.GetItem("rocketRingItem"));
gameState.heroes[3].SetJewel(caster.GetItem("krakenRockItem"));
- Tile tiles1[64];
-
- tiles1[ 0].SetOffset(Vector<int>(2, 1));
- tiles1[ 1].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_WEST);
- tiles1[ 2].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles1[ 3].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_EAST);
- tiles1[ 4].SetOffset(Vector<int>(0, 1));
- tiles1[ 5].SetOffset(Vector<int>(2, 0));
- tiles1[ 6].SetOffset(Vector<int>(2, 0));
- tiles1[ 7].SetOffset(Vector<int>(2, 0));
-
- tiles1[ 8].SetOffset(Vector<int>(2, 1));
- tiles1[ 9].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles1[10].SetOffset(Vector<int>(3, 0));
- tiles1[11].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles1[12].SetOffset(Vector<int>(0, 2));
- tiles1[13].SetOffset(Vector<int>(1, 2));
- tiles1[14].SetOffset(Vector<int>(1, 2));
- tiles1[15].SetOffset(Vector<int>(1, 2));
-
- tiles1[16].SetOffset(Vector<int>(2, 1));
- tiles1[17].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles1[18].SetOffset(Vector<int>(3, 0));
- tiles1[19].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles1[20].SetOffset(Vector<int>(0, 3));
- tiles1[21].SetOffset(Vector<int>(1, 3));
- tiles1[22].SetOffset(Vector<int>(1, 3));
- tiles1[23].SetOffset(Vector<int>(2, 3));
-
- tiles1[24].SetOffset(Vector<int>(2, 1));
- tiles1[25].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles1[26].SetOffset(Vector<int>(3, 0));
- tiles1[27].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles1[28].SetOffset(Vector<int>(0, 4));
- tiles1[29].SetOffset(Vector<int>(1, 4));
- tiles1[30].SetOffset(Vector<int>(1, 4));
- tiles1[31].SetOffset(Vector<int>(2, 4));
-
- tiles1[32].SetOffset(Vector<int>(2, 1));
- tiles1[33].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles1[34].SetOffset(Vector<int>(3, 0));
- tiles1[35].SetOffset(Vector<int>(3, 0));
- tiles1[36].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles1[37].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles1[38].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles1[39].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
-
- tiles1[40].SetOffset(Vector<int>(2, 1));
- tiles1[41].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles1[42].SetOffset(Vector<int>(3, 0));
- tiles1[43].SetOffset(Vector<int>(3, 0));
- tiles1[44].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles1[45].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles1[46].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles1[47].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
-
- tiles1[48].SetOffset(Vector<int>(2, 1));
- tiles1[49].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles1[50].SetOffset(Vector<int>(3, 0));
- tiles1[51].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles1[52].SetOffset(Vector<int>(0, 0));
- tiles1[53].SetOffset(Vector<int>(1, 0));
- tiles1[54].SetOffset(Vector<int>(1, 0));
- tiles1[55].SetOffset(Vector<int>(1, 0));
-
- tiles1[56].SetOffset(Vector<int>(2, 1));
- tiles1[57].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH | Tile::BLOCK_WEST);
- tiles1[58].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles1[59].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH | Tile::BLOCK_EAST);
- tiles1[60].SetOffset(Vector<int>(0, 1));
- tiles1[61].SetOffset(Vector<int>(1, 1));
- tiles1[62].SetOffset(Vector<int>(1, 1));
- tiles1[63].SetOffset(Vector<int>(1, 1));
-
- Tile tiles2[64];
-
- tiles2[ 0].SetOffset(Vector<int>(2, 0));
- tiles2[ 1].SetOffset(Vector<int>(2, 0));
- tiles2[ 2].SetOffset(Vector<int>(2, 0));
- tiles2[ 3].SetOffset(Vector<int>(2, 0));
- tiles2[ 4].SetOffset(Vector<int>(2, 0));
- tiles2[ 5].SetOffset(Vector<int>(2, 0));
- tiles2[ 6].SetOffset(Vector<int>(2, 0));
- tiles2[ 7].SetOffset(Vector<int>(2, 0));
-
- tiles2[ 8].SetOffset(Vector<int>(1, 2));
- tiles2[ 9].SetOffset(Vector<int>(1, 2));
- tiles2[10].SetOffset(Vector<int>(5, 3));
- tiles2[11].SetOffset(Vector<int>(2, 0));
- tiles2[12].SetOffset(Vector<int>(2, 0));
- tiles2[13].SetOffset(Vector<int>(2, 0));
- tiles2[14].SetOffset(Vector<int>(2, 0));
- tiles2[15].SetOffset(Vector<int>(2, 0));
-
- tiles2[16].SetOffset(Vector<int>(3, 3));
- tiles2[17].SetOffset(Vector<int>(0, 3));
- tiles2[18].SetOffset(Vector<int>(0, 1));
- tiles2[19].SetOffset(Vector<int>(2, 0));
- tiles2[20].SetOffset(Vector<int>(2, 0));
- tiles2[21].SetOffset(Vector<int>(2, 0));
- tiles2[22].SetOffset(Vector<int>(2, 0));
- tiles2[23].SetOffset(Vector<int>(2, 0));
-
- tiles2[24].SetOffset(Vector<int>(3, 4)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_EAST | Tile::BLOCK_WEST);
- tiles2[25].SetOffset(Vector<int>(0, 4));
- tiles2[26].SetOffset(Vector<int>(0, 1));
- tiles2[27].SetOffset(Vector<int>(2, 0));
- tiles2[28].SetOffset(Vector<int>(2, 0));
- tiles2[29].SetOffset(Vector<int>(2, 0));
- tiles2[30].SetOffset(Vector<int>(2, 0));
- tiles2[31].SetOffset(Vector<int>(2, 0));
-
- tiles2[32].SetOffset(Vector<int>(5, 0));
- tiles2[33].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_EAST);
- tiles2[34].SetOffset(Vector<int>(0, 1));
- tiles2[35].SetOffset(Vector<int>(2, 0));
- tiles2[36].SetOffset(Vector<int>(2, 0));
- tiles2[37].SetOffset(Vector<int>(2, 0));
- tiles2[38].SetOffset(Vector<int>(2, 0));
- tiles2[39].SetOffset(Vector<int>(2, 0));
-
- tiles2[40].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles2[41].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH | Tile::BLOCK_EAST);
- tiles2[42].SetOffset(Vector<int>(0, 1));
- tiles2[43].SetOffset(Vector<int>(2, 0));
- tiles2[44].SetOffset(Vector<int>(2, 0));
- tiles2[45].SetOffset(Vector<int>(2, 0));
- tiles2[46].SetOffset(Vector<int>(2, 0));
- tiles2[47].SetOffset(Vector<int>(2, 0));
-
- tiles2[48].SetOffset(Vector<int>(1, 0));
- tiles2[49].SetOffset(Vector<int>(1, 0));
- tiles2[50].SetOffset(Vector<int>(5, 4));
- tiles2[51].SetOffset(Vector<int>(2, 0));
- tiles2[52].SetOffset(Vector<int>(2, 0));
- tiles2[53].SetOffset(Vector<int>(2, 0));
- tiles2[54].SetOffset(Vector<int>(2, 0));
- tiles2[55].SetOffset(Vector<int>(2, 0));
-
- tiles2[56].SetOffset(Vector<int>(2, 0));
- tiles2[57].SetOffset(Vector<int>(2, 0));
- tiles2[58].SetOffset(Vector<int>(2, 0));
- tiles2[59].SetOffset(Vector<int>(2, 0));
- tiles2[60].SetOffset(Vector<int>(2, 0));
- tiles2[61].SetOffset(Vector<int>(2, 0));
- tiles2[62].SetOffset(Vector<int>(2, 0));
- tiles2[63].SetOffset(Vector<int>(2, 0));
-
- Area areas1[2];
- areas1[0].SetTiles(tiles1, 64);
- areas1[0].SetWidth(8);
- areas1[1].SetTiles(tiles2, 64);
- areas1[1].SetWidth(8);
-
- Trigger triggers1[1];
- triggers1[0].SetTilePosition(Vector<int>(8, 3));
- triggers1[0].SetType(Trigger::TYPE_NORTH);
-
- SDL_Surface *tilesetImg(IMG_Load("test-data/tileset.png"));
- Sprite tileset(tilesetImg, tileSize, tileSize);
-
- Map map1;
- map1.SetAreas(areas1, 2);
- map1.SetTileset(&tileset);
- map1.SetTriggers(triggers1, 1);
- map1.SetWidth(2);
- map1.SetBattleBackground(bg);
-
- Tile tiles3[64];
-
- tiles3[ 0].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_WEST);
- tiles3[ 1].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles3[ 2].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles3[ 3].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles3[ 4].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles3[ 5].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles3[ 6].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
- tiles3[ 7].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_EAST);
-
- tiles3[ 8].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles3[ 9].SetOffset(Vector<int>(3, 0));
- tiles3[10].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles3[11].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles3[12].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles3[13].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
- tiles3[14].SetOffset(Vector<int>(4, 0));
- tiles3[15].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH);
-
- tiles3[16].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles3[17].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles3[18].SetOffset(Vector<int>(0, 0));
- tiles3[19].SetOffset(Vector<int>(1, 0));
- tiles3[20].SetOffset(Vector<int>(1, 0));
- tiles3[21].SetOffset(Vector<int>(3, 2));
- tiles3[22].SetOffset(Vector<int>(4, 2)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH | Tile::BLOCK_WEST);
- tiles3[23].SetOffset(Vector<int>(5, 2));
-
- tiles3[24].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles3[25].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles3[26].SetOffset(Vector<int>(0, 1));
- tiles3[27].SetOffset(Vector<int>(2, 0));
- tiles3[28].SetOffset(Vector<int>(2, 0));
- tiles3[29].SetOffset(Vector<int>(1, 2));
- tiles3[30].SetOffset(Vector<int>(1, 2));
- tiles3[31].SetOffset(Vector<int>(1, 2));
-
- tiles3[32].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles3[33].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles3[34].SetOffset(Vector<int>(0, 1));
- tiles3[35].SetOffset(Vector<int>(2, 0));
- tiles3[36].SetOffset(Vector<int>(2, 0));
- tiles3[37].SetOffset(Vector<int>(2, 3));
- tiles3[38].SetOffset(Vector<int>(3, 3));
- tiles3[39].SetOffset(Vector<int>(0, 3));
-
- tiles3[40].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles3[41].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles3[42].SetOffset(Vector<int>(0, 1));
- tiles3[43].SetOffset(Vector<int>(2, 0));
- tiles3[44].SetOffset(Vector<int>(2, 0));
- tiles3[45].SetOffset(Vector<int>(2, 4));
- tiles3[46].SetOffset(Vector<int>(3, 4));
- tiles3[47].SetOffset(Vector<int>(0, 4));
-
- tiles3[48].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
- tiles3[49].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
- tiles3[50].SetOffset(Vector<int>(0, 1));
- tiles3[51].SetOffset(Vector<int>(2, 0));
- tiles3[52].SetOffset(Vector<int>(2, 0));
- tiles3[53].SetOffset(Vector<int>(4, 1));
- tiles3[54].SetOffset(Vector<int>(5, 1));
- tiles3[55].SetOffset(Vector<int>(3, 1));
-
- tiles3[56].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH | Tile::BLOCK_WEST);
- tiles3[57].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH);
- tiles3[58].SetOffset(Vector<int>(0, 1));
- tiles3[59].SetOffset(Vector<int>(2, 0));
- tiles3[60].SetOffset(Vector<int>(2, 0));
- tiles3[61].SetOffset(Vector<int>(2, 0));
- tiles3[62].SetOffset(Vector<int>(2, 0));
- tiles3[63].SetOffset(Vector<int>(2, 0));
-
- Area areas2[1];
- areas2[0].SetTiles(tiles3, 64);
- areas2[0].SetWidth(8);
-
- Trigger triggers2[1];
- triggers2[0].SetTilePosition(Vector<int>(6, 2));
- triggers2[0].SetType(Trigger::TYPE_SOUTH);
-
- Map map2;
- map2.SetAreas(areas2, 1);
- map2.SetTileset(&tileset);
- map2.SetTriggers(triggers2, 1);
- map2.SetWidth(1);
- map2.SetBattleBackground(bg);
-
- unsigned char transition1text[4 + sizeof(int) + sizeof(Map *) + sizeof(Vector<int>)];
- int i(0);
- transition1text[i++] = Script::CODE_MOVE_I0;
- *reinterpret_cast<int *>(transition1text + i) = 1;
- i += sizeof(int);
- transition1text[i++] = Script::CODE_MOVE_A0;
- *reinterpret_cast<Map **>(transition1text + i) = &map2;
- i += sizeof(Map *);
- transition1text[i++] = Script::CODE_MOVE_V0;
- *reinterpret_cast<Vector<int> *>(transition1text + i) = Vector<int>(6, 2);
- i += sizeof(Vector<int>);
- transition1text[i++] = Script::CODE_SYSCALL;
-
- Script transition1;
- transition1.text = transition1text;
- transition1.textlen = sizeof(transition1text);
-
- triggers1[0].SetScript(&transition1);
-
- unsigned char transition2text[4 + sizeof(int) + sizeof(Map *) + sizeof(Vector<int>)];
- i = 0;
- transition2text[i++] = Script::CODE_MOVE_I0;
- *reinterpret_cast<int *>(transition2text + i) = 1;
- i += sizeof(int);
- transition2text[i++] = Script::CODE_MOVE_A0;
- *reinterpret_cast<Map **>(transition2text + i) = &map1;
- i += sizeof(Map *);
- transition2text[i++] = Script::CODE_MOVE_V0;
- *reinterpret_cast<Vector<int> *>(transition2text + i) = Vector<int>(8, 3);
- i += sizeof(Vector<int>);
- transition2text[i++] = Script::CODE_SYSCALL;
-
- Script transition2;
- transition2.text = transition2text;
- transition2.textlen = sizeof(transition2text);
-
- triggers2[0].SetScript(&transition2);
-
gameState.heroes[0].MapEntity().Position() = Vector<float>(64, 128);
gameState.heroes[1].MapEntity().Position() = Vector<float>(64, 128);
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);
- mapPopulation[0].SetAnimation(&mapMonsterAnimation);
- mapPopulation[0].Position() = Vector<float>(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<float>(64, 160);
- mapPopulation[1].SetFlags(Entity::FLAG_PUSHABLE | Entity::FLAG_FIXED_ORIENTATION);
-
InitScreen screen(width, height);
app::State *state(0);
battleState->AddHero(gameState.heroes[3]);
state = battleState;
} else {
- MapState *mapState(new MapState(&gameConfig, &map1));
+ MapState *mapState(new MapState(&gameConfig, caster.GetMap("map1")));
mapState->ControlEntity(&gameState.heroes[0].MapEntity());
mapState->SetWalkingSpeed(walkSpeed);
- mapPopulation[0].StartAnimation(*mapState);
state = mapState;
}
--- /dev/null
+include "constants.l2h"
+
+export Map map1 {
+ tileset: Sprite {
+ image: :"tileset.png",
+ size: <32, 32>
+ },
+ battlebg: :"battle-bg.png",
+ width: 2,
+ areas: [ Area
+ {
+ width: 8,
+ tiles: [ Tile
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockNW },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockNE },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 2> },
+ { t: <1, 2> },
+ { t: <1, 2> },
+ { t: <1, 2> },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 3> },
+ { t: <1, 3> },
+ { t: <1, 3> },
+ { t: <2, 3> },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 4> },
+ { t: <1, 4> },
+ { t: <1, 4> },
+ { t: <2, 4> },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockS },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 0> },
+ { t: <1, 0> },
+ { t: <1, 0> },
+ { t: <1, 0> },
+
+ { t: <2, 1> },
+ { t: <4, 0>, flags: blockSW },
+ { t: <3, 0>, flags: blockS },
+ { t: <3, 0>, flags: blockES },
+ { t: <0, 1> },
+ { t: <1, 1> },
+ { t: <1, 1> },
+ { t: <1, 1> }
+ ]
+ },
+ {
+ width: 8,
+ tiles: [ Tile
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <1, 2> },
+ { t: <1, 2> },
+ { t: <5, 3> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <3, 3> },
+ { t: <0, 3> },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <3, 4>, flags: blockNEW },
+ { t: <0, 4> },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <5, 0> },
+ { t: <3, 0>, flags: blockNE },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <4, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockES },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <1, 0> },
+ { t: <1, 0> },
+ { t: <5, 4> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> }
+ ]
+ }
+ ],
+ triggers: [ Trigger
+ {
+ position: <8, 3>,
+ type: triggerNorth,
+ script: <<
+ $move %i0 1
+ $move %a0 map2
+ $move %v0 <6, 2>
+ $sysc
+ >>
+ }
+ ],
+ entities: [ Entity
+ {
+ animation: SimpleAnimation {
+ sprite: Sprite {
+ image: :"monster-map.png",
+ size: <32, 32>
+ },
+ framecount: 2,
+ frametime: 500,
+ repeat: true
+ },
+ position: <2, 1>,
+ partyLayout: monstersLayout
+ // TODO: monsters
+ },
+ {
+ sprite: Sprite {
+ image: :"tileset.png",
+ size: <32, 32>,
+ offset: <96, 32>
+ },
+ position: <2, 5>,
+ flags: 6 // TODO: hard support for flags
+ }
+ ]
+}
+
+export Map map2 {
+ tileset: Sprite {
+ image: :"tileset.png",
+ size: <32, 32>
+ },
+ battlebg: :"battle-bg.png",
+ width: 2,
+ areas: [ Area
+ {
+ width: 8,
+ tiles: [ Tile
+ { t: <3, 0>, flags: blockNW },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockN },
+ { t: <3, 0>, flags: blockNE },
+
+ { t: <3, 0>, flags: blockW },
+ { t: <3, 0> },
+ { t: <3, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockS },
+ { t: <4, 0>, flags: blockS },
+ { t: <4, 0> },
+ { t: <4, 0>, flags: blockES },
+
+ { t: <3, 0>, flags: blockW },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 0> },
+ { t: <1, 0> },
+ { t: <1, 0> },
+ { t: <3, 2> },
+ { t: <4, 2>, flags: blockESW },
+ { t: <5, 2> },
+
+ { t: <3, 0>, flags: blockW },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <1, 2> },
+ { t: <1, 2> },
+ { t: <1, 2> },
+
+ { t: <3, 0>, flags: blockW },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 4> },
+ { t: <3, 4> },
+ { t: <0, 4> },
+
+ { t: <3, 0>, flags: blockW },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <4, 1> },
+ { t: <5, 1> },
+ { t: <3, 1> },
+
+ { t: <3, 0>, flags: blockW },
+ { t: <3, 0>, flags: blockE },
+ { t: <0, 1> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> },
+ { t: <2, 0> }
+ ]
+ }
+ ],
+ triggers: [ Trigger
+ {
+ position: <6, 2>,
+ type: triggerSouth,
+ script: <<
+ $move %i0 1
+ $move %a0 map1
+ $move %v0 <8, 3>
+ $sysc
+ >>
+ }
+ ]
+}