diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 10:11:23 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 10:11:23 -0500 |
| commit | 59dfd3da4d3e5d4a368a664c51c22bbdc8ff2ca4 (patch) | |
| tree | a86427d740156719879baba4b0577285a5849f7a /src/game.cpp | |
| parent | 560ac0c3f5fc561a3db490d8f4a33c3e19296083 (diff) | |
| download | tanetane-59dfd3da4d3e5d4a368a664c51c22bbdc8ff2ca4.tar.gz tanetane-59dfd3da4d3e5d4a368a664c51c22bbdc8ff2ca4.tar.bz2 tanetane-59dfd3da4d3e5d4a368a664c51c22bbdc8ff2ca4.zip | |
Added sprite shadows
Diffstat (limited to 'src/game.cpp')
| -rw-r--r-- | src/game.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
| diff --git a/src/game.cpp b/src/game.cpp index fcd5f44..d1e5b8e 100644 --- a/src/game.cpp +++ b/src/game.cpp | |||
| @@ -34,6 +34,7 @@ void Game::loadMap(std::string filename, std::string warpPoint, Direction dir) { | |||
| 34 | getSystem<TransformSystem>().setUpCollision(lucasSprite, {-8, -8}, {12, 8}, true); | 34 | getSystem<TransformSystem>().setUpCollision(lucasSprite, {-8, -8}, {12, 8}, true); |
| 35 | getSystem<AnimationSystem>().initSprite(lucasSprite, "../res/sprites/lucas_anim.txt"); | 35 | getSystem<AnimationSystem>().initSprite(lucasSprite, "../res/sprites/lucas_anim.txt"); |
| 36 | getSystem<AnimationSystem>().setSpriteDirection(lucasSprite, dir); | 36 | getSystem<AnimationSystem>().setSpriteDirection(lucasSprite, dir); |
| 37 | getSprite(lucasSprite).hasShadow = true; | ||
| 37 | getSprite(lucasSprite).player = true; | 38 | getSprite(lucasSprite).player = true; |
| 38 | getSystem<CharacterSystem>().initSprite(lucasSprite); | 39 | getSystem<CharacterSystem>().initSprite(lucasSprite); |
| 39 | 40 | ||
| @@ -41,18 +42,21 @@ void Game::loadMap(std::string filename, std::string warpPoint, Direction dir) { | |||
| 41 | getSystem<TransformSystem>().initSprite(kumaSprite, warpLoc); | 42 | getSystem<TransformSystem>().initSprite(kumaSprite, warpLoc); |
| 42 | getSystem<AnimationSystem>().initSprite(kumaSprite, "../res/sprites/kuma_anim.txt"); | 43 | getSystem<AnimationSystem>().initSprite(kumaSprite, "../res/sprites/kuma_anim.txt"); |
| 43 | getSystem<AnimationSystem>().setSpriteDirection(kumaSprite, dir); | 44 | getSystem<AnimationSystem>().setSpriteDirection(kumaSprite, dir); |
| 45 | getSprite(kumaSprite).hasShadow = true; | ||
| 44 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, kumaSprite); | 46 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, kumaSprite); |
| 45 | 47 | ||
| 46 | int dusterSprite = emplaceSprite("duster"); | 48 | int dusterSprite = emplaceSprite("duster"); |
| 47 | getSystem<TransformSystem>().initSprite(dusterSprite, warpLoc); | 49 | getSystem<TransformSystem>().initSprite(dusterSprite, warpLoc); |
| 48 | getSystem<AnimationSystem>().initSprite(dusterSprite, "../res/sprites/duster_anim.txt"); | 50 | getSystem<AnimationSystem>().initSprite(dusterSprite, "../res/sprites/duster_anim.txt"); |
| 49 | getSystem<AnimationSystem>().setSpriteDirection(dusterSprite, dir); | 51 | getSystem<AnimationSystem>().setSpriteDirection(dusterSprite, dir); |
| 52 | getSprite(dusterSprite).hasShadow = true; | ||
| 50 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, dusterSprite); | 53 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, dusterSprite); |
| 51 | 54 | ||
| 52 | int boneySprite = emplaceSprite("boney"); | 55 | int boneySprite = emplaceSprite("boney"); |
| 53 | getSystem<TransformSystem>().initSprite(boneySprite, warpLoc); | 56 | getSystem<TransformSystem>().initSprite(boneySprite, warpLoc); |
| 54 | getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt"); | 57 | getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt"); |
| 55 | getSystem<AnimationSystem>().setSpriteDirection(boneySprite, dir); | 58 | getSystem<AnimationSystem>().setSpriteDirection(boneySprite, dir); |
| 59 | getSprite(boneySprite).hasShadow = true; | ||
| 56 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite); | 60 | getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite); |
| 57 | 61 | ||
| 58 | for (const Prototype& p : map_->getPrototypes()) { | 62 | for (const Prototype& p : map_->getPrototypes()) { |
| @@ -61,6 +65,7 @@ void Game::loadMap(std::string filename, std::string warpPoint, Direction dir) { | |||
| 61 | getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true); | 65 | getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true); |
| 62 | if (!p.animationFilename.empty()) { | 66 | if (!p.animationFilename.empty()) { |
| 63 | getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename); | 67 | getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename); |
| 68 | getSprite(spriteId).hasShadow = p.shadow; | ||
| 64 | } | 69 | } |
| 65 | getSprite(spriteId).interactionScript = p.interactionScript; | 70 | getSprite(spriteId).interactionScript = p.interactionScript; |
| 66 | } | 71 | } |
