diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-10 11:22:16 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-10 11:22:16 -0500 |
commit | fb58cb31804da7e5e40fc861927060a183962441 (patch) | |
tree | e5355f3c8865f239085b666818c9cb5ef4a0c619 | |
parent | 8a39ba20ad46092b5242a44b103814136edcf025 (diff) | |
download | tanetane-fb58cb31804da7e5e40fc861927060a183962441.tar.gz tanetane-fb58cb31804da7e5e40fc861927060a183962441.tar.bz2 tanetane-fb58cb31804da7e5e40fc861927060a183962441.zip |
When changing map, place whole party at the warp
-rw-r--r-- | src/game.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp index 861e8ee..530068c 100644 --- a/src/game.cpp +++ b/src/game.cpp | |||
@@ -27,25 +27,27 @@ void Game::loadMap(std::string filename, std::string warpPoint) { | |||
27 | 27 | ||
28 | map_ = std::make_unique<Map>(filename); | 28 | map_ = std::make_unique<Map>(filename); |
29 | 29 | ||
30 | vec2i warpLoc = map_->getWarpPoint(warpPoint); | ||
31 | |||
30 | int lucasSprite = emplaceSprite("lucas"); | 32 | int lucasSprite = emplaceSprite("lucas"); |
31 | getSystem<TransformSystem>().initSprite(lucasSprite, map_->getWarpPoint(warpPoint)); | 33 | getSystem<TransformSystem>().initSprite(lucasSprite, warpLoc); |
32 | getSystem<TransformSystem>().setUpCollision(lucasSprite, {-8, -8}, {12, 8}, true); | 34 | getSystem<TransformSystem>().setUpCollision(lucasSprite, {-8, -8}, {12, 8}, true); |
33 | getSystem<AnimationSystem>().initSprite(lucasSprite, "../res/sprites/lucas_anim.txt"); | 35 | getSystem<AnimationSystem>().initSprite(lucasSprite, "../res/sprites/lucas_anim.txt"); |
34 | getSprite(lucasSprite).controllable = true; | 36 | getSprite(lucasSprite).controllable = true; |
35 | getSystem<CharacterSystem>().initSprite(lucasSprite); | 37 | getSystem<CharacterSystem>().initSprite(lucasSprite); |
36 | 38 | ||
37 | int kumaSprite = emplaceSprite("kuma"); | 39 | int kumaSprite = emplaceSprite("kuma"); |
38 | getSystem<TransformSystem>().initSprite(kumaSprite, {32, 32}); | 40 | getSystem<TransformSystem>().initSprite(kumaSprite, warpLoc); |
39 | getSystem<AnimationSystem>().initSprite(kumaSprite, "../res/sprites/kuma_anim.txt"); | 41 | getSystem<AnimationSystem>().initSprite(kumaSprite, "../res/sprites/kuma_anim.txt"); |
40 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, kumaSprite); | 42 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, kumaSprite); |
41 | 43 | ||
42 | int dusterSprite = emplaceSprite("duster"); | 44 | int dusterSprite = emplaceSprite("duster"); |
43 | getSystem<TransformSystem>().initSprite(dusterSprite, {32, 32}); | 45 | getSystem<TransformSystem>().initSprite(dusterSprite, warpLoc); |
44 | getSystem<AnimationSystem>().initSprite(dusterSprite, "../res/sprites/duster_anim.txt"); | 46 | getSystem<AnimationSystem>().initSprite(dusterSprite, "../res/sprites/duster_anim.txt"); |
45 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, dusterSprite); | 47 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, dusterSprite); |
46 | 48 | ||
47 | int boneySprite = emplaceSprite("boney"); | 49 | int boneySprite = emplaceSprite("boney"); |
48 | getSystem<TransformSystem>().initSprite(boneySprite, {32, 32}); | 50 | getSystem<TransformSystem>().initSprite(boneySprite, warpLoc); |
49 | getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt"); | 51 | getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt"); |
50 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite); | 52 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite); |
51 | 53 | ||