Skip to content

Commit 0666d05

Browse files
committed
Add level completed cutscene after defeating first boss
- Add level completed cutscene - Add crystal ball item
1 parent 94b360b commit 0666d05

32 files changed

+435
-91
lines changed

src/GameCuaTao/Castlevania.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
<ClCompile Include="Castlevania\Hud.cpp" />
194194
<ClCompile Include="Castlevania\Models\Characters\Player\PlayerRenderingSystem.cpp" />
195195
<ClCompile Include="Castlevania\Models\GameObject.cpp" />
196+
<ClCompile Include="Castlevania\Models\Health.cpp" />
196197
<ClCompile Include="Castlevania\Models\Items\BreakableWall.cpp" />
197198
<ClCompile Include="Castlevania\Models\Items\Door.cpp" />
198199
<ClCompile Include="Castlevania\Models\Items\DoorRenderingSystem.cpp" />
@@ -236,6 +237,7 @@
236237
<ClCompile Include="Castlevania\Scenes\Stages\GoToCastleCutScene.cpp" />
237238
<ClCompile Include="Castlevania\Scenes\Stages\HiddenMoneyBagCutscene.cpp" />
238239
<ClCompile Include="Castlevania\Scenes\Stages\IntroCutscene.cpp" />
240+
<ClCompile Include="Castlevania\Scenes\Stages\LevelCompletedCutscene.cpp" />
239241
<ClCompile Include="Castlevania\Scenes\Stages\ResetCutscene.cpp" />
240242
<ClCompile Include="Castlevania\Scenes\Stages\NextMapCutscene.cpp" />
241243
<ClCompile Include="Castlevania\Scenes\Stages\NextRoomCutscene.cpp" />
@@ -357,6 +359,7 @@
357359
<ClInclude Include="Castlevania\Models\Characters\Player\PlayerData.h" />
358360
<ClInclude Include="Castlevania\Models\Characters\Player\PlayerRenderingSystem.h" />
359361
<ClInclude Include="Castlevania\Models\GameObject.h" />
362+
<ClInclude Include="Castlevania\Models\Health.h" />
360363
<ClInclude Include="Castlevania\Models\IBoss.h" />
361364
<ClInclude Include="Castlevania\Models\Items\BreakableWall.h" />
362365
<ClInclude Include="Castlevania\Models\Items\Door.h" />

src/GameCuaTao/Castlevania.vcxproj.filters

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,12 @@
492492
<ClCompile Include="Castlevania\Scenes\Stages\IntroCutscene.cpp">
493493
<Filter>Source Files</Filter>
494494
</ClCompile>
495+
<ClCompile Include="Castlevania\Scenes\Stages\LevelCompletedCutscene.cpp">
496+
<Filter>Source Files</Filter>
497+
</ClCompile>
498+
<ClCompile Include="Castlevania\Models\Health.cpp">
499+
<Filter>Source Files</Filter>
500+
</ClCompile>
495501
</ItemGroup>
496502
<ItemGroup>
497503
<ClInclude Include="Library\pugixml.hpp">
@@ -1136,6 +1142,9 @@
11361142
<ClInclude Include="Castlevania\Scenes\Stages\IntroCutscene.h">
11371143
<Filter>Header Files</Filter>
11381144
</ClInclude>
1145+
<ClInclude Include="Castlevania\Models\Health.h">
1146+
<Filter>Header Files</Filter>
1147+
</ClInclude>
11391148
</ItemGroup>
11401149
<ItemGroup>
11411150
<None Include="cpp.hint" />

src/GameCuaTao/Castlevania/CastlevaniaGame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void CastlevaniaGame::Initialize()
1919
Game::Initialize();
2020

2121
sceneManager = std::make_unique<SceneManager>(*this);
22-
sceneManager->SetNextScene(Scene::MENU); // TODO: change back to MENU
22+
sceneManager->SetNextScene(Scene::GAMEPLAY); // TODO: change back to MENU
2323
}
2424

2525
void CastlevaniaGame::LoadContent()

src/GameCuaTao/Castlevania/Content/Items/Crystal_Ball.atlas.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
<Spritesheet TexturePath="Crystal_Ball.png">
66
<Sprite ID="flash_01">
77
<SpriteFrame Left="0" Top="0" Width="28" Height="32" />
8+
<SpriteBoundary Left="3" Top="3" Width="22" Height="26" />
89
</Sprite>
910

1011
<Sprite ID="flash_02">
1112
<SpriteFrame Left="28" Top="0" Width="28" Height="32" />
13+
<SpriteBoundary Left="31" Top="3" Width="22" Height="26" />
1214
</Sprite>
1315
</Spritesheet>
1416

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

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<map version="1.2" tiledversion="1.2.1" orientation="orthogonal" renderorder="right-down" width="88" height="6" tilewidth="64" tileheight="64" infinite="0" nextlayerid="10" nextobjectid="135">
33
<tileset firstgid="1" source="../Simon.tsx"/>
44
<tileset firstgid="73" source="../Static_Objects.tsx"/>
5-
<tileset firstgid="82" source="../Candle.tsx"/>
5+
<tileset firstgid="83" source="../Candle.tsx"/>
66
<layer id="1" name="TileLayer01" width="88" height="6">
77
<data encoding="base64" compression="gzip">
88
H4sIAAAAAAAACmNgGAWjYBSMglEwCkbBKCANAADzn1fmQAgAAA==
@@ -97,224 +97,224 @@
9797
<property name="SpawnObject" value="Panther"/>
9898
</properties>
9999
</object>
100-
<object id="32" name="Candle" type="Candle" gid="82" x="56" y="290" width="16" height="32">
100+
<object id="32" name="Candle" type="Candle" gid="83" x="56" y="290" width="16" height="32">
101101
<properties>
102102
<property name="Item" value="BlueMoneyBag"/>
103103
</properties>
104104
</object>
105-
<object id="33" name="Candle" type="Candle" gid="82" x="184" y="226" width="16" height="32">
105+
<object id="33" name="Candle" type="Candle" gid="83" x="184" y="226" width="16" height="32">
106106
<properties>
107107
<property name="Item" value="SmallHeart"/>
108108
</properties>
109109
</object>
110-
<object id="34" name="Candle" type="Candle" gid="82" x="440" y="226" width="16" height="32">
110+
<object id="34" name="Candle" type="Candle" gid="83" x="440" y="226" width="16" height="32">
111111
<properties>
112112
<property name="Item" value="RedMoneyBag"/>
113113
</properties>
114114
</object>
115-
<object id="35" name="Candle" type="Candle" gid="82" x="308" y="290" width="16" height="32">
115+
<object id="35" name="Candle" type="Candle" gid="83" x="308" y="290" width="16" height="32">
116116
<properties>
117117
<property name="Item" value="SmallHeart"/>
118118
</properties>
119119
</object>
120-
<object id="36" name="Candle" type="Candle" gid="82" x="564" y="290" width="16" height="32">
120+
<object id="36" name="Candle" type="Candle" gid="83" x="564" y="290" width="16" height="32">
121121
<properties>
122122
<property name="Item" value="SmallHeart"/>
123123
</properties>
124124
</object>
125-
<object id="37" name="Candle" type="Candle" gid="82" x="694" y="226" width="16" height="32">
125+
<object id="37" name="Candle" type="Candle" gid="83" x="694" y="226" width="16" height="32">
126126
<properties>
127127
<property name="Item" value="RedMoneyBag"/>
128128
</properties>
129129
</object>
130-
<object id="38" name="Candle" type="Candle" gid="82" x="822" y="290" width="16" height="32">
130+
<object id="38" name="Candle" type="Candle" gid="83" x="822" y="290" width="16" height="32">
131131
<properties>
132132
<property name="Item" value="SmallHeart"/>
133133
</properties>
134134
</object>
135-
<object id="39" name="Candle" type="Candle" gid="82" x="950" y="226" width="16" height="32">
135+
<object id="39" name="Candle" type="Candle" gid="83" x="950" y="226" width="16" height="32">
136136
<properties>
137137
<property name="Item" value="SmallHeart"/>
138138
</properties>
139139
</object>
140-
<object id="40" name="Candle" type="Candle" gid="82" x="1078" y="290" width="16" height="32">
140+
<object id="40" name="Candle" type="Candle" gid="83" x="1078" y="290" width="16" height="32">
141141
<properties>
142142
<property name="Item" value="SmallHeart"/>
143143
</properties>
144144
</object>
145-
<object id="41" name="Candle" type="Candle" gid="82" x="1206" y="226" width="16" height="32">
145+
<object id="41" name="Candle" type="Candle" gid="83" x="1206" y="226" width="16" height="32">
146146
<properties>
147147
<property name="Item" value="SmallHeart"/>
148148
</properties>
149149
</object>
150-
<object id="42" name="Candle" type="Candle" gid="82" x="1462" y="290" width="16" height="32">
150+
<object id="42" name="Candle" type="Candle" gid="83" x="1462" y="290" width="16" height="32">
151151
<properties>
152152
<property name="Item" value="WhiteMoneyBag"/>
153153
</properties>
154154
</object>
155-
<object id="43" name="Candle" type="Candle" gid="82" x="1334" y="98" width="16" height="32">
155+
<object id="43" name="Candle" type="Candle" gid="83" x="1334" y="98" width="16" height="32">
156156
<properties>
157157
<property name="Item" value="RedMoneyBag"/>
158158
</properties>
159159
</object>
160-
<object id="44" name="Candle" type="Candle" gid="82" x="1590" y="34" width="16" height="32">
160+
<object id="44" name="Candle" type="Candle" gid="83" x="1590" y="34" width="16" height="32">
161161
<properties>
162162
<property name="Item" value="HolyWaterItem"/>
163163
</properties>
164164
</object>
165-
<object id="45" name="Candle" type="Candle" gid="82" x="1718" y="98" width="16" height="32">
165+
<object id="45" name="Candle" type="Candle" gid="83" x="1718" y="98" width="16" height="32">
166166
<properties>
167167
<property name="Item" value="LargeHeart"/>
168168
</properties>
169169
</object>
170-
<object id="46" name="Candle" type="Candle" gid="82" x="1974" y="98" width="16" height="32">
170+
<object id="46" name="Candle" type="Candle" gid="83" x="1974" y="98" width="16" height="32">
171171
<properties>
172172
<property name="Item" value="SmallHeart"/>
173173
</properties>
174174
</object>
175-
<object id="47" name="Candle" type="Candle" gid="82" x="1846" y="290" width="16" height="32">
175+
<object id="47" name="Candle" type="Candle" gid="83" x="1846" y="290" width="16" height="32">
176176
<properties>
177177
<property name="Item" value="WhiteMoneyBag"/>
178178
</properties>
179179
</object>
180-
<object id="48" name="Candle" type="Candle" gid="82" x="2102" y="290" width="16" height="32">
180+
<object id="48" name="Candle" type="Candle" gid="83" x="2102" y="290" width="16" height="32">
181181
<properties>
182182
<property name="Item" value="SmallHeart"/>
183183
</properties>
184184
</object>
185-
<object id="49" name="Candle" type="Candle" gid="82" x="2230" y="290" width="16" height="32">
185+
<object id="49" name="Candle" type="Candle" gid="83" x="2230" y="290" width="16" height="32">
186186
<properties>
187187
<property name="Item" value="SmallHeart"/>
188188
</properties>
189189
</object>
190-
<object id="50" name="Candle" type="Candle" gid="82" x="2358" y="290" width="16" height="32">
190+
<object id="50" name="Candle" type="Candle" gid="83" x="2358" y="290" width="16" height="32">
191191
<properties>
192192
<property name="Item" value="SmallHeart"/>
193193
</properties>
194194
</object>
195-
<object id="51" name="Candle" type="Candle" gid="82" x="2484" y="290" width="16" height="32">
195+
<object id="51" name="Candle" type="Candle" gid="83" x="2484" y="290" width="16" height="32">
196196
<properties>
197197
<property name="Item" value="SmallHeart"/>
198198
</properties>
199199
</object>
200-
<object id="52" name="Candle" type="Candle" gid="82" x="2612" y="290" width="16" height="32">
200+
<object id="52" name="Candle" type="Candle" gid="83" x="2612" y="290" width="16" height="32">
201201
<properties>
202202
<property name="Item" value="SmallHeart"/>
203203
</properties>
204204
</object>
205-
<object id="53" name="Candle" type="Candle" gid="82" x="2740" y="226" width="16" height="32">
205+
<object id="53" name="Candle" type="Candle" gid="83" x="2740" y="226" width="16" height="32">
206206
<properties>
207207
<property name="Item" value="SmallHeart"/>
208208
</properties>
209209
</object>
210-
<object id="54" name="Candle" type="Candle" gid="82" x="2860" y="98" width="16" height="32">
210+
<object id="54" name="Candle" type="Candle" gid="83" x="2860" y="98" width="16" height="32">
211211
<properties>
212212
<property name="Item" value="SmallHeart"/>
213213
</properties>
214214
</object>
215-
<object id="55" name="Candle" type="Candle" gid="82" x="3256" y="98" width="16" height="32">
215+
<object id="55" name="Candle" type="Candle" gid="83" x="3256" y="98" width="16" height="32">
216216
<properties>
217217
<property name="Item" value="LargeHeart"/>
218218
</properties>
219219
</object>
220-
<object id="56" name="Candle" type="Candle" gid="82" x="3384" y="66" width="16" height="32">
220+
<object id="56" name="Candle" type="Candle" gid="83" x="3384" y="66" width="16" height="32">
221221
<properties>
222222
<property name="Item" value="RedMoneyBag"/>
223223
</properties>
224224
</object>
225-
<object id="57" name="Candle" type="Candle" gid="82" x="3512" y="226" width="16" height="32">
225+
<object id="57" name="Candle" type="Candle" gid="83" x="3512" y="226" width="16" height="32">
226226
<properties>
227227
<property name="Item" value="RedMoneyBag"/>
228228
</properties>
229229
</object>
230-
<object id="58" name="Candle" type="Candle" gid="82" x="3128" y="290" width="16" height="32">
230+
<object id="58" name="Candle" type="Candle" gid="83" x="3128" y="290" width="16" height="32">
231231
<properties>
232232
<property name="Item" value="WhiteMoneyBag"/>
233233
</properties>
234234
</object>
235-
<object id="59" name="Candle" type="Candle" gid="82" x="3672" y="66" width="16" height="32">
235+
<object id="59" name="Candle" type="Candle" gid="83" x="3672" y="66" width="16" height="32">
236236
<properties>
237237
<property name="Item" value="LargeHeart"/>
238238
</properties>
239239
</object>
240-
<object id="60" name="Candle" type="Candle" gid="82" x="3766" y="290" width="16" height="32">
240+
<object id="60" name="Candle" type="Candle" gid="83" x="3766" y="290" width="16" height="32">
241241
<properties>
242242
<property name="Item" value="RedMoneyBag"/>
243243
</properties>
244244
</object>
245-
<object id="61" name="Candle" type="Candle" gid="82" x="3896" y="36" width="16" height="32">
245+
<object id="61" name="Candle" type="Candle" gid="83" x="3896" y="36" width="16" height="32">
246246
<properties>
247247
<property name="Item" value="LargeHeart"/>
248248
</properties>
249249
</object>
250-
<object id="62" name="Candle" type="Candle" gid="82" x="4024" y="98" width="16" height="32">
250+
<object id="62" name="Candle" type="Candle" gid="83" x="4024" y="98" width="16" height="32">
251251
<properties>
252252
<property name="Item" value="SmallHeart"/>
253253
</properties>
254254
</object>
255-
<object id="63" name="Candle" type="Candle" gid="82" x="4280" y="98" width="16" height="32">
255+
<object id="63" name="Candle" type="Candle" gid="83" x="4280" y="98" width="16" height="32">
256256
<properties>
257257
<property name="Item" value="RedMoneyBag"/>
258258
</properties>
259259
</object>
260-
<object id="64" name="Candle" type="Candle" gid="82" x="4408" y="162" width="16" height="32">
260+
<object id="64" name="Candle" type="Candle" gid="83" x="4408" y="162" width="16" height="32">
261261
<properties>
262262
<property name="Item" value="SmallHeart"/>
263263
</properties>
264264
</object>
265-
<object id="65" name="Candle" type="Candle" gid="82" x="4152" y="226" width="16" height="32">
265+
<object id="65" name="Candle" type="Candle" gid="83" x="4152" y="226" width="16" height="32">
266266
<properties>
267267
<property name="Item" value="LargeHeart"/>
268268
</properties>
269269
</object>
270-
<object id="66" name="Candle" type="Candle" gid="82" x="4536" y="98" width="16" height="32">
270+
<object id="66" name="Candle" type="Candle" gid="83" x="4536" y="98" width="16" height="32">
271271
<properties>
272272
<property name="Item" value="InvisibleJar"/>
273273
</properties>
274274
</object>
275-
<object id="67" name="Candle" type="Candle" gid="82" x="4790" y="226" width="16" height="32">
275+
<object id="67" name="Candle" type="Candle" gid="83" x="4790" y="226" width="16" height="32">
276276
<properties>
277277
<property name="Item" value="AxeItem"/>
278278
</properties>
279279
</object>
280-
<object id="68" name="Candle" type="Candle" gid="82" x="4664" y="290" width="16" height="32">
280+
<object id="68" name="Candle" type="Candle" gid="83" x="4664" y="290" width="16" height="32">
281281
<properties>
282282
<property name="Item" value="SmallHeart"/>
283283
</properties>
284284
</object>
285-
<object id="69" name="Candle" type="Candle" gid="82" x="4918" y="290" width="16" height="32">
285+
<object id="69" name="Candle" type="Candle" gid="83" x="4918" y="290" width="16" height="32">
286286
<properties>
287287
<property name="Item" value="SmallHeart"/>
288288
</properties>
289289
</object>
290-
<object id="70" name="Candle" type="Candle" gid="82" x="5046" y="290" width="16" height="32">
290+
<object id="70" name="Candle" type="Candle" gid="83" x="5046" y="290" width="16" height="32">
291291
<properties>
292292
<property name="Item" value="SmallHeart"/>
293293
</properties>
294294
</object>
295-
<object id="71" name="Candle" type="Candle" gid="82" x="5174" y="226" width="16" height="32">
295+
<object id="71" name="Candle" type="Candle" gid="83" x="5174" y="226" width="16" height="32">
296296
<properties>
297297
<property name="Item" value="LargeHeart"/>
298298
</properties>
299299
</object>
300-
<object id="72" name="Candle" type="Candle" gid="82" x="5302" y="290" width="16" height="32">
300+
<object id="72" name="Candle" type="Candle" gid="83" x="5302" y="290" width="16" height="32">
301301
<properties>
302302
<property name="Item" value="SmallHeart"/>
303303
</properties>
304304
</object>
305-
<object id="73" name="Candle" type="Candle" gid="82" x="5430" y="226" width="16" height="32">
305+
<object id="73" name="Candle" type="Candle" gid="83" x="5430" y="226" width="16" height="32">
306306
<properties>
307307
<property name="Item" value="RedMoneyBag"/>
308308
</properties>
309309
</object>
310-
<object id="74" name="Candle" type="Candle" gid="82" x="5558" y="226" width="16" height="32">
310+
<object id="74" name="Candle" type="Candle" gid="83" x="5558" y="226" width="16" height="32">
311311
<properties>
312312
<property name="Item" value="LargeHeart"/>
313313
</properties>
314314
</object>
315315
<object id="75" name="Door" type="Door" gid="77" x="3048" y="128" width="24" height="96"/>
316316
<object id="76" name="Door" type="Door" gid="77" x="4072" y="128" width="24" height="96"/>
317-
<object id="119" name="Candle" type="Candle" gid="82" x="2998" y="34" width="16" height="32">
317+
<object id="119" name="Candle" type="Candle" gid="83" x="2998" y="34" width="16" height="32">
318318
<properties>
319319
<property name="Item" value="Cross"/>
320320
</properties>

src/GameCuaTao/Castlevania/Hud.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ constexpr auto HUD_HEIGHT = 83;
88
constexpr auto POWERUP_FLASHING_TIME = 2500;
99

1010
const auto DEFAULT_PLAYER_DATA = PlayerData{};
11-
const auto DEFAULT_BOSS_HEALTH = MAX_HEALTH;
11+
const auto DEFAULT_BOSS_HEALTH = Health{ MAX_HEALTH };
1212
const auto DEFAULT_GAMEPLAY_DATA = GameplayData{};
1313

1414
struct Hud::HudData
1515
{
1616
const PlayerData *playerData;
17-
const int *bossHealth;
17+
const Health *bossHealth;
1818
const GameplayData *gameplayData;
1919
};
2020

@@ -57,7 +57,7 @@ void Hud::Register(const PlayerData &playerData)
5757
data->playerData = &playerData;
5858
}
5959

60-
void Hud::Register(const int &bossHealth)
60+
void Hud::Register(const Health &bossHealth)
6161
{
6262
data->bossHealth = &bossHealth;
6363
}
@@ -207,9 +207,12 @@ Vector2 Hud::GetPowerupPosition(Texture &powerupTexture)
207207

208208
void Hud::DrawHealthBars(SpriteExtensions &spriteBatch)
209209
{
210+
auto playerHealth = data->playerData->health.Value();
211+
auto bossHealth = data->bossHealth->Value();
212+
210213
for (auto i = 0; i < MAX_HEALTH; i++)
211214
{
212-
if (i + 1 <= data->playerData->health)
215+
if (i + 1 <= playerHealth)
213216
{
214217
auto position = Vector2{ playerHealthPosition.x + i * 9, playerHealthPosition.y };
215218
spriteBatch.Draw(*playerFullBlock, position, false);
@@ -220,7 +223,7 @@ void Hud::DrawHealthBars(SpriteExtensions &spriteBatch)
220223
spriteBatch.Draw(*emptyBlock, position, false);
221224
}
222225

223-
if (i + 1 <= *data->bossHealth)
226+
if (i + 1 <= bossHealth)
224227
{
225228
auto position = Vector2{ enemyHealthPosition.x + i * 9, enemyHealthPosition.y };
226229
spriteBatch.Draw(*bossFullBlock, position, false);

0 commit comments

Comments
 (0)