Skip to content

Commit

Permalink
Lazyload map instead of loading all maps once at startup, many bug fixes
Browse files Browse the repository at this point in the history
- Maps are now lazyload when needed
- Fix boss fight area not working since the last commit
- Fix pressing CONTINUE button in gameover screen also proceed to continue in menuscreen
- Fix jump-attack make player go through wall
- Fix bounce back when taking damage make player go through wall
- Other minor tweaks
  • Loading branch information
NearHuscarl committed Jan 1, 2019
1 parent b60fc1b commit 5a52a32
Show file tree
Hide file tree
Showing 29 changed files with 229 additions and 169 deletions.
6 changes: 4 additions & 2 deletions src/GameCuaTao/Castlevania.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<ClCompile Include="Castlevania\Models\Characters\Enemies\Zombie.cpp" />
<ClCompile Include="Castlevania\Models\Characters\Enemies\ZombieResponseSystem.cpp" />
<ClCompile Include="Castlevania\Models\Characters\Player\Player.cpp" />
<ClCompile Include="Castlevania\Models\Characters\Player\PlayerCollisionSystem.cpp" />
<ClCompile Include="Castlevania\Models\Facing.cpp" />
<ClCompile Include="Castlevania\Models\Factories\ObjectFactory.cpp" />
<ClCompile Include="Castlevania\Hud.cpp" />
Expand All @@ -204,7 +205,7 @@
<ClCompile Include="Castlevania\Models\Spawners\FishmanSpawnArea.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\SpawnArea.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\SpawnAreaResponseSystem.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\SpawnerCollisionSystem.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\AreaCollisionSystem.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\SpawnPoint.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\VampireBatSpawnArea.cpp" />
<ClCompile Include="Castlevania\Models\Spawners\ZombieSpawnArea.cpp" />
Expand Down Expand Up @@ -354,6 +355,7 @@
<ClInclude Include="Castlevania\Models\Characters\Enemies\ZombieResponseSystem.h" />
<ClInclude Include="Castlevania\Models\Characters\Player\NearbyObjects.h" />
<ClInclude Include="Castlevania\Models\Characters\Player\Player.h" />
<ClInclude Include="Castlevania\Models\Characters\Player\PlayerCollisionSystem.h" />
<ClInclude Include="Castlevania\Models\Facing.h" />
<ClInclude Include="Castlevania\Models\Factories\ObjectCollection.h" />
<ClInclude Include="Castlevania\Models\Factories\ObjectFactory.h" />
Expand All @@ -377,7 +379,7 @@
<ClInclude Include="Castlevania\Models\Spawners\ISpawner.h" />
<ClInclude Include="Castlevania\Models\Spawners\SpawnArea.h" />
<ClInclude Include="Castlevania\Models\Spawners\SpawnAreaResponseSystem.h" />
<ClInclude Include="Castlevania\Models\Spawners\SpawnerCollisionSystem.h" />
<ClInclude Include="Castlevania\Models\Spawners\AreaCollisionSystem.h" />
<ClInclude Include="Castlevania\Models\Spawners\SpawnPoint.h" />
<ClInclude Include="Castlevania\Models\Spawners\VampireBatSpawnArea.h" />
<ClInclude Include="Castlevania\Models\Spawners\ZombieSpawnArea.h" />
Expand Down
18 changes: 12 additions & 6 deletions src/GameCuaTao/Castlevania.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,6 @@
<ClCompile Include="Castlevania\Models\Spawners\ZombieSpawnArea.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Castlevania\Models\Spawners\SpawnerCollisionSystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Castlevania\Models\Spawners\SpawnAreaResponseSystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -504,6 +501,12 @@
<ClCompile Include="Direct2DGame\Graphics\Viewport.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Castlevania\Models\Spawners\AreaCollisionSystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Castlevania\Models\Characters\Player\PlayerCollisionSystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Library\pugixml.hpp">
Expand Down Expand Up @@ -977,9 +980,6 @@
<ClInclude Include="Castlevania\Models\Spawners\ZombieSpawnArea.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Castlevania\Models\Spawners\SpawnerCollisionSystem.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Castlevania\Models\Spawners\SpawnAreaResponseSystem.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -1154,6 +1154,12 @@
<ClInclude Include="Castlevania\Models\Checkpoint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Castlevania\Models\Spawners\AreaCollisionSystem.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Castlevania\Models\Characters\Player\PlayerCollisionSystem.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<Sprite ID="attack_03">
<SpriteFrame Left="420" Top="66" Width="60" Height="66" />
<SpriteBoundary Left="436" Top="72" Width="43" Height="58" />
<SpriteBoundary Left="436" Top="72" Width="32" Height="58" />
</Sprite>

<Sprite ID="jump_01">
Expand Down Expand Up @@ -115,7 +115,7 @@

<Sprite ID="jump_attack_03">
<SpriteFrame Left="420" Top="0" Width="60" Height="66" />
<SpriteBoundary Left="435" Top="11" Width="44" Height="44" />
<SpriteBoundary Left="436" Top="11" Width="32" Height="44" />
</Sprite>

<Sprite ID="duck_attack_01"> <!-- OffsetY = -9 -->
Expand All @@ -125,12 +125,12 @@

<Sprite ID="duck_attack_02"> <!-- OffsetY = -9 -->
<SpriteFrame Left="360" Top="-9" Width="60" Height="66" />
<SpriteBoundary Left="377" Top="9" Width="32" Height="46" />
<SpriteBoundary Left="376" Top="9" Width="32" Height="46" />
</Sprite>

<Sprite ID="duck_attack_03"> <!-- OffsetY = -9 -->
<SpriteFrame Left="420" Top="-9" Width="60" Height="66" />
<SpriteBoundary Left="435" Top="11" Width="44" Height="44" />
<SpriteBoundary Left="436" Top="11" Width="32" Height="44" />
</Sprite>

<Sprite ID="turn_backward_01">
Expand All @@ -140,7 +140,7 @@

<Sprite ID="take_damage_01">
<SpriteFrame Left="0" Top="132" Width="60" Height="66" />
<SpriteBoundary Left="10" Top="138" Width="32" Height="58" />
<SpriteBoundary Left="12" Top="138" Width="30" Height="58" />
</Sprite>

<!-- ========================== -->
Expand Down Expand Up @@ -218,7 +218,7 @@

<Sprite ID="attack_invisible_03">
<SpriteFrame Left="420" Top="462" Width="60" Height="66" />
<SpriteBoundary Left="436" Top="468" Width="43" Height="58" />
<SpriteBoundary Left="436" Top="468" Width="32" Height="58" />
</Sprite>

<Sprite ID="jump_invisible_01">
Expand Down Expand Up @@ -313,7 +313,7 @@

<Sprite ID="jump_attack_invisible_03">
<SpriteFrame Left="420" Top="396" Width="60" Height="66" />
<SpriteBoundary Left="435" Top="407" Width="44" Height="44" />
<SpriteBoundary Left="436" Top="407" Width="32" Height="44" />
</Sprite>

<Sprite ID="duck_attack_invisible_01"> <!-- OffsetY = -9 -->
Expand All @@ -323,12 +323,12 @@

<Sprite ID="duck_attack_invisible_02"> <!-- OffsetY = -9 -->
<SpriteFrame Left="360" Top="387" Width="60" Height="66" />
<SpriteBoundary Left="377" Top="405" Width="32" Height="46" />
<SpriteBoundary Left="376" Top="405" Width="32" Height="46" />
</Sprite>

<Sprite ID="duck_attack_invisible_03"> <!-- OffsetY = -9 -->
<SpriteFrame Left="420" Top="387" Width="60" Height="66" />
<SpriteBoundary Left="435" Top="407" Width="44" Height="44" />
<SpriteBoundary Left="436" Top="407" Width="32" Height="44" />
</Sprite>

<Sprite ID="turn_backward_invisible_01">
Expand All @@ -338,7 +338,7 @@

<Sprite ID="take_damage_invisible_01">
<SpriteFrame Left="0" Top="528" Width="60" Height="66" />
<SpriteBoundary Left="10" Top="534" Width="32" Height="58" />
<SpriteBoundary Left="12" Top="534" Width="30" Height="58" />
</Sprite>

</Spritesheet>
Expand Down
7 changes: 1 addition & 6 deletions src/GameCuaTao/Castlevania/Content/TiledMaps/Intro/Intro.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@
</object>
</objectgroup>
<objectgroup color="#ff0000" id="8" name="Locations">
<object id="47" name="Entrypoint1" type="Position" gid="2147483652" x="478" y="319" width="60" height="66">
<properties>
<property name="Facing" value="Left"/>
</properties>
</object>
<object id="56" name="Entrypoint" type="Position" gid="2147483652" x="513" y="319" width="60" height="66">
<object id="47" name="Entrypoint" type="Position" gid="2147483652" x="490" y="319" width="60" height="66">
<properties>
<property name="Facing" value="Left"/>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
<tileset firstgid="73" source="../Brazier.tsx"/>
<tileset firstgid="75" source="../Money_Bag.tsx"/>
<tileset firstgid="78" source="../Static_Objects.tsx"/>
<tileset firstgid="88" name="Courtyard" tilewidth="64" tileheight="64" tilecount="40" columns="10">
<tileset firstgid="89" name="Courtyard" tilewidth="64" tileheight="64" tilecount="40" columns="10">
<image source="Courtyard.bmp" width="640" height="256"/>
</tileset>
<layer id="18" name="TileLayer" width="24" height="6">
<properties>
<property name="ColorKey" type="color" value="#ff050505"/>
</properties>
<data encoding="csv">
89,90,90,90,90,90,91,91,89,90,90,90,90,90,91,91,91,91,91,91,92,93,93,94,
95,96,95,95,95,95,90,90,95,96,95,95,95,95,90,90,90,90,97,97,98,99,100,101,
96,102,96,96,96,96,96,96,96,102,96,96,96,96,96,96,96,96,102,102,103,104,100,105,
106,107,102,106,106,102,106,102,106,107,102,106,106,102,106,102,102,102,107,108,109,110,111,112,
113,114,115,113,113,115,113,115,113,114,115,113,113,115,113,115,115,116,114,117,118,119,120,121,
108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108
90,91,91,91,91,91,92,92,90,91,91,91,91,91,92,92,92,92,92,92,93,94,94,95,
96,97,96,96,96,96,91,91,96,97,96,96,96,96,91,91,91,91,98,98,99,100,101,102,
97,103,97,97,97,97,97,97,97,103,97,97,97,97,97,97,97,97,103,103,104,105,101,106,
107,108,103,107,107,103,107,103,107,108,103,107,107,103,107,103,103,103,108,109,110,111,112,113,
114,115,116,114,114,116,114,116,114,115,116,114,114,116,114,116,116,117,115,118,119,120,121,122,
109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109
</data>
</layer>
<objectgroup color="#00557f" id="3" name="Bounds">
<object id="20" name="Ground" type="Boundary" x="0" y="288" width="1536" height="32"/>
<object id="22" name="LeftBorder" type="Boundary" x="0" y="0" width="3" height="288"/>
<object id="24" name="RightBorder" type="Boundary" x="1504" y="0" width="32" height="288"/>
<object id="24" name="RightBorder" type="Boundary" x="1518" y="0" width="18" height="288"/>
</objectgroup>
<objectgroup color="#ffaa00" id="4" name="Entities">
<object id="15" name="Brazier" type="Brazier" gid="73" x="175" y="290" width="32" height="64">
Expand Down
Loading

0 comments on commit 5a52a32

Please sign in to comment.