Skip to content

Commit d53bf08

Browse files
committed
Bug fixes
- Fix player dying animation make the camera glitching - Fix water effect not spawning when player and fishmen fall from the far right side of underground map - Fix add-time-bonus sound effect glitching - Fix fireballs sometimes hit simon (false positive) when she's standing on the higher platform in underground (hopefully)
1 parent 89f7d26 commit d53bf08

File tree

16 files changed

+90
-37
lines changed

16 files changed

+90
-37
lines changed
106 Bytes
Binary file not shown.

src/GameCuaTao/Castlevania/Content/TiledMaps/Stage_01/Underground.tmx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<map version="1.2" tiledversion="1.2.1" orientation="orthogonal" renderorder="right-down" width="16" height="6" tilewidth="64" tileheight="64" infinite="0" nextlayerid="11" nextobjectid="43">
2+
<map version="1.2" tiledversion="1.2.1" orientation="orthogonal" renderorder="right-down" width="16" height="6" tilewidth="64" tileheight="64" infinite="0" nextlayerid="11" nextobjectid="45">
33
<tileset firstgid="1" source="../Candle.tsx"/>
44
<tileset firstgid="3" source="../Simon.tsx"/>
55
<tileset firstgid="75" source="../Static_Objects.tsx"/>
@@ -83,8 +83,10 @@
8383
<property name="Item" value="BlueMoneyBag"/>
8484
</properties>
8585
</object>
86-
<object id="41" name="WaterArea" type="WaterArea" gid="85" x="384" y="365" width="192" height="73"/>
87-
<object id="42" name="WaterArea" type="WaterArea" gid="85" x="512" y="365" width="192" height="73"/>
86+
<object id="41" name="WaterArea" type="WaterArea" gid="85" x="384" y="365" width="192" height="43"/>
87+
<object id="42" name="WaterArea" type="WaterArea" gid="85" x="512" y="365" width="192" height="43"/>
88+
<object id="43" name="WaterArea" type="WaterArea" gid="85" x="704" y="365" width="192" height="43"/>
89+
<object id="44" name="WaterArea" type="WaterArea" gid="85" x="960" y="365" width="192" height="43"/>
8890
</objectgroup>
8991
<objectgroup color="#55ff7f" id="8" name="Foregrounds">
9092
<object id="39" name="Block" type="BrickBlock" gid="81" x="672" y="192" width="32" height="32"/>
-475 Bytes
Loading

src/GameCuaTao/Castlevania/Content/TiledMaps/Static_Objects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
<image source="../Misc/Cloud.png" width="64" height="28"/>
3232
</tile>
3333
<tile id="10">
34-
<image source="Stage_01/Water_Area.png" width="192" height="73"/>
34+
<image source="Stage_01/Water_Area.png" width="192" height="43"/>
3535
</tile>
3636
</tileset>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
3+
<GameContent>
4+
5+
<Spritesheet TexturePath="Fireball.png">
6+
<Sprite ID="fire_ball">
7+
<SpriteFrame Left="0" Top="0" Width="15" Height="11" />
8+
<SpriteBoundary Left="0" Top="10" Width="15" Height="1" />
9+
</Sprite>
10+
</Spritesheet>
11+
12+
</GameContent>

src/GameCuaTao/Castlevania/Models/Characters/Enemies/Fishman.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ void Fishman::Update(UpdateData &updateData)
2929

3030
if (updateData.isStopwatchActive)
3131
if (renderingSystem != nullptr && fishmanState == FishmanState::LAUNCHING)
32+
{
3233
renderingSystem->Update(updateData.gameTime); // Update launching effect
34+
return;
35+
}
3336

3437
switch (fishmanState)
3538
{

src/GameCuaTao/Castlevania/Models/Characters/Enemies/GiantBat.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ GiantBatState GiantBat::GetGiantBatState()
9898
void GiantBat::Update(UpdateData &updateData)
9999
{
100100
Enemy::Update(updateData);
101+
102+
if (updateData.isStopwatchActive)
103+
return;
101104

102105
switch (giantBatState)
103106
{

src/GameCuaTao/Castlevania/Models/Characters/Player/Player.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ namespace Castlevania
153153
Stopwatch throwingCooldownTimer;
154154
Stopwatch invisibleTimer;
155155

156-
// Component-related flags
156+
// Component-related members
157157
NearbyObjects nearbyObjects;
158158

159159
// Need a reference to the height of the platform the player was standing before jumping

src/GameCuaTao/Castlevania/Models/Characters/Player/PlayerResponseSystem.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,13 @@ void PlayerResponseSystem::OnCollideWithStairDownTrigger(Trigger &trigger)
508508

509509
void PlayerResponseSystem::OnCollideWithNextMapTrigger(Trigger &trigger)
510510
{
511-
parent.Notify(NEXT_MAP_CUTSCENE_STARTED);
512-
trigger.GetBody().Enabled(false);
511+
// Fix an edge case where player just jumps and collides with the next map trigger in
512+
// underground map (should trigger when walking up/down stairs and on ground only)
513+
if (!parent.IsOnTheAir())
514+
{
515+
parent.Notify(NEXT_MAP_CUTSCENE_STARTED);
516+
trigger.GetBody().Enabled(false);
517+
}
513518
}
514519

515520
void PlayerResponseSystem::OnCollideWithMoneyBagTrigger(Trigger &trigger)

src/GameCuaTao/Castlevania/Models/Factories/ObjectFactory.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,13 @@ std::unique_ptr<RangedWeapon> ObjectFactory::CreateFireball(Vector2 position)
558558
{
559559
auto object = std::make_unique<RangedWeapon>(ObjectId::Fireball);
560560
auto stats = content.Load<Dictionary>("GameStats/Weapons/Fireball.xml");
561-
562561
ReadSubWeaponConfig(*object.get(), *stats);
563562

564563
auto movementSystem = std::make_unique<SimpleMovementSystem>(*object);
565-
auto renderingSystem = std::make_unique<ItemRenderingSystem>(*object, "Weapons/Fireball.png",
564+
565+
auto spritesheet = content.Load<Spritesheet>("Weapons/Fireball.atlas.xml");
566+
auto textureRegion = spritesheet->begin()->second;
567+
auto renderingSystem = std::make_unique<ItemRenderingSystem>(*object, textureRegion,
566568
effectFactory->CreateFlameEffect(),
567569
effectFactory->CreateSparkEffect());
568570

0 commit comments

Comments
 (0)