-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add cross powerup - Kill all enemy in viewport area continously. Lasts 0.75 seconds - Crop bounding box background texture to a more resonable size - Fix next map cutscene and reset cutscene background not drawing at all
- Loading branch information
1 parent
81b911a
commit 776fa26
Showing
18 changed files
with
127 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-2.17 KB
(34%)
src/GameCuaTao/Castlevania/Content/Backgrounds/BoundingBox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
src/GameCuaTao/Castlevania/Content/TiledMaps/Stage_01/Great_Hall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/GameCuaTao/Castlevania/Scenes/Stages/CrossCutscene.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "CrossCutscene.h" | ||
#include "Stage.h" | ||
#include "StageEvent.h" | ||
#include "../../Utilities/MapSettings.h" | ||
|
||
using namespace Castlevania; | ||
|
||
constexpr auto CROSS_TIME = 750; // in milliseconds | ||
|
||
CrossCutscene::CrossCutscene(Stage &stage, ContentManager &content, CollisionGrid &grid) : | ||
Cutscene{ stage }, | ||
grid{ grid } | ||
{ | ||
auto backgroundTexture = content.Load<Texture>("Backgrounds/BoundingBox.png"); | ||
background = std::make_unique<Sprite>(backgroundTexture); | ||
|
||
crossTimer.Start(); | ||
} | ||
|
||
void CrossCutscene::Update(UpdateData &updateData) | ||
{ | ||
grid.GetCellsFromBoundingBox(stage.GetCamera()->GetBounds(), [&](CollisionCell &cell, int col, int row) | ||
{ | ||
auto &entities = cell.GetEntites(); | ||
|
||
for (auto &entity : entities) | ||
{ | ||
auto enemy = dynamic_cast<Enemy*>(entity.get()); | ||
|
||
if (enemy != nullptr) | ||
enemy->Die(); | ||
} | ||
}); | ||
|
||
stage.UpdateGameplay(updateData); | ||
|
||
if (crossTimer.ElapsedMilliseconds() >= CROSS_TIME) | ||
{ | ||
stage.OnNotify(Subject::Empty(), CUTSCENE_ENDED); | ||
isComplete = true; | ||
} | ||
} | ||
|
||
void CrossCutscene::Draw(SpriteExtensions &spriteBatch) | ||
{ | ||
background->SetColor(Stopwatch::Every(1) ? MAP_BLACK_COLOR : MAP_WHITE_COLOR); | ||
spriteBatch.Draw(*background, Vector2::Zero(), false); | ||
Cutscene::Draw(spriteBatch); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "Direct2DGame/Utilities/Stopwatch.h" | ||
#include "Cutscene.h" | ||
|
||
namespace Castlevania | ||
{ | ||
class CrossCutscene : public Cutscene | ||
{ | ||
public: | ||
CrossCutscene(Stage &stage, ContentManager &content, CollisionGrid &grid); | ||
|
||
void Update(UpdateData &updateData) override; | ||
void Draw(SpriteExtensions &spriteBatch) override; | ||
|
||
private: | ||
std::unique_ptr<Sprite> background; | ||
Stopwatch crossTimer; | ||
CollisionGrid &grid; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters