summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-24 10:42:31 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2021-02-24 16:00:53 -0500
commit5faac69bb14dc1d064b108c5109ab1a53200549f (patch)
treefad672f07ea28accdbc368b514b8d06b1814bd7a /src
parentdf093323e48426e8d54a504aeae4155fa3c8e605 (diff)
downloadtanetane-5faac69bb14dc1d064b108c5109ab1a53200549f.tar.gz
tanetane-5faac69bb14dc1d064b108c5109ab1a53200549f.tar.bz2
tanetane-5faac69bb14dc1d064b108c5109ab1a53200549f.zip
Removed sprite shadow while on a ladder
Diffstat (limited to 'src')
-rw-r--r--src/character_system.cpp2
-rw-r--r--src/game.cpp2
-rw-r--r--src/main.cpp8
-rw-r--r--src/sprite.h1
4 files changed, 8 insertions, 5 deletions
diff --git a/src/character_system.cpp b/src/character_system.cpp index ea469d5..5a3b774 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp
@@ -345,11 +345,13 @@ void CharacterSystem::setAnimationFor(int spriteId, CharacterState state) {
345 } 345 }
346 346
347 game_.getSystem<AnimationSystem>().setSpriteAnimation(spriteId, animName); 347 game_.getSystem<AnimationSystem>().setSpriteAnimation(spriteId, animName);
348 sprite.hasShadow = sprite.normallyHasShadow;
348 349
349 break; 350 break;
350 } 351 }
351 case CharacterMedium::Ladder: { 352 case CharacterMedium::Ladder: {
352 game_.getSystem<AnimationSystem>().setSpriteAnimation(spriteId, "climb"); 353 game_.getSystem<AnimationSystem>().setSpriteAnimation(spriteId, "climb");
354 sprite.hasShadow = false;
353 355
354 if (state == CharacterState::Still || state == CharacterState::Crouching) { 356 if (state == CharacterState::Still || state == CharacterState::Crouching) {
355 sprite.animPaused = true; 357 sprite.animPaused = true;
diff --git a/src/game.cpp b/src/game.cpp index b5393a8..2a4308f 100644 --- a/src/game.cpp +++ b/src/game.cpp
@@ -59,7 +59,7 @@ void Game::loadMap(std::string filename) {
59 getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true); 59 getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize, true);
60 if (!p.animationFilename.empty()) { 60 if (!p.animationFilename.empty()) {
61 getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename); 61 getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename);
62 getSprite(spriteId).hasShadow = p.shadow; 62 getSprite(spriteId).normallyHasShadow = p.shadow;
63 } 63 }
64 getSprite(spriteId).interactionScript = p.interactionScript; 64 getSprite(spriteId).interactionScript = p.interactionScript;
65 if (p.movementSpeed != -1) { 65 if (p.movementSpeed != -1) {
diff --git a/src/main.cpp b/src/main.cpp index 5c8a018..25e7013 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -36,7 +36,7 @@ void loop(Renderer& renderer, std::mt19937& rng) {
36 game.getSystem<TransformSystem>().setUpCollision(lucasSprite, {-8, -8}, {12, 8}, true); 36 game.getSystem<TransformSystem>().setUpCollision(lucasSprite, {-8, -8}, {12, 8}, true);
37 game.getSystem<AnimationSystem>().initSprite(lucasSprite, "../res/sprites/lucas_anim.txt"); 37 game.getSystem<AnimationSystem>().initSprite(lucasSprite, "../res/sprites/lucas_anim.txt");
38 game.getSystem<AnimationSystem>().setSpriteDirection(lucasSprite, Direction::down); 38 game.getSystem<AnimationSystem>().setSpriteDirection(lucasSprite, Direction::down);
39 game.getSprite(lucasSprite).hasShadow = true; 39 game.getSprite(lucasSprite).normallyHasShadow = true;
40 game.getSprite(lucasSprite).player = true; 40 game.getSprite(lucasSprite).player = true;
41 game.getSprite(lucasSprite).controllable = true; 41 game.getSprite(lucasSprite).controllable = true;
42 game.getSprite(lucasSprite).persistent = true; 42 game.getSprite(lucasSprite).persistent = true;
@@ -48,7 +48,7 @@ void loop(Renderer& renderer, std::mt19937& rng) {
48 game.getSystem<TransformSystem>().initSprite(kumaSprite, warpLoc); 48 game.getSystem<TransformSystem>().initSprite(kumaSprite, warpLoc);
49 game.getSystem<AnimationSystem>().initSprite(kumaSprite, "../res/sprites/kuma_anim.txt"); 49 game.getSystem<AnimationSystem>().initSprite(kumaSprite, "../res/sprites/kuma_anim.txt");
50 game.getSystem<AnimationSystem>().setSpriteDirection(kumaSprite, Direction::down); 50 game.getSystem<AnimationSystem>().setSpriteDirection(kumaSprite, Direction::down);
51 game.getSprite(kumaSprite).hasShadow = true; 51 game.getSprite(kumaSprite).normallyHasShadow = true;
52 game.getSprite(kumaSprite).persistent = true; 52 game.getSprite(kumaSprite).persistent = true;
53 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, kumaSprite); 53 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, kumaSprite);
54 54
@@ -56,7 +56,7 @@ void loop(Renderer& renderer, std::mt19937& rng) {
56 game.getSystem<TransformSystem>().initSprite(dusterSprite, warpLoc); 56 game.getSystem<TransformSystem>().initSprite(dusterSprite, warpLoc);
57 game.getSystem<AnimationSystem>().initSprite(dusterSprite, "../res/sprites/duster_anim.txt"); 57 game.getSystem<AnimationSystem>().initSprite(dusterSprite, "../res/sprites/duster_anim.txt");
58 game.getSystem<AnimationSystem>().setSpriteDirection(dusterSprite, Direction::down); 58 game.getSystem<AnimationSystem>().setSpriteDirection(dusterSprite, Direction::down);
59 game.getSprite(dusterSprite).hasShadow = true; 59 game.getSprite(dusterSprite).normallyHasShadow = true;
60 game.getSprite(dusterSprite).persistent = true; 60 game.getSprite(dusterSprite).persistent = true;
61 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, dusterSprite); 61 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, dusterSprite);
62 62
@@ -64,7 +64,7 @@ void loop(Renderer& renderer, std::mt19937& rng) {
64 game.getSystem<TransformSystem>().initSprite(boneySprite, warpLoc); 64 game.getSystem<TransformSystem>().initSprite(boneySprite, warpLoc);
65 game.getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt"); 65 game.getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt");
66 game.getSystem<AnimationSystem>().setSpriteDirection(boneySprite, Direction::down); 66 game.getSystem<AnimationSystem>().setSpriteDirection(boneySprite, Direction::down);
67 game.getSprite(boneySprite).hasShadow = true; 67 game.getSprite(boneySprite).normallyHasShadow = true;
68 game.getSprite(boneySprite).persistent = true; 68 game.getSprite(boneySprite).persistent = true;
69 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite); 69 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite);
70 70
diff --git a/src/sprite.h b/src/sprite.h index 2bbc4ea..3c2eade 100644 --- a/src/sprite.h +++ b/src/sprite.h
@@ -75,6 +75,7 @@ public:
75 std::map<std::string, std::map<Direction, int>> nameDirToAnim; 75 std::map<std::string, std::map<Direction, int>> nameDirToAnim;
76 bool animFinished = false; 76 bool animFinished = false;
77 bool hasShadow = false; 77 bool hasShadow = false;
78 bool normallyHasShadow = false;
78 bool animPaused = false; 79 bool animPaused = false;
79 80
80 // Character 81 // Character