Add fly animations
This commit is contained in:
242
.idea/.idea.Motherload/.idea/workspace.xml
generated
242
.idea/.idea.Motherload/.idea/workspace.xml
generated
@@ -11,16 +11,30 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="26a0623a-44d5-441c-8048-32ff1dab3479" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/Game/Levels/World/OrbitingObject.cpp" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Game/Levels/World/OrbitingObject.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Game.vcxproj" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Game.vcxproj" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Engine/Collision.h" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/Collision.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Engine/SoundEffect.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/SoundEffect.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Engine/SoundEffect.h" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/SoundEffect.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Engine/Text.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/Text.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Engine/colors.h" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/colors.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/GameManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GameManager.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/GameManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GameManager.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/GuiMeter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/GuiMeter.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/GuiText.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/GuiText.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/MainScreen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/MainScreen.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/MainScreen.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/MainScreen.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Levels/World/Building.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/Building.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Levels/World/Building.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/Building.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Player.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Game/Player.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Resources/gui/fuel/background.png" beforeDir="false" afterPath="$PROJECT_DIR$/Resources/gui/fuel/background.png" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -34,7 +48,191 @@
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="GitHubPullRequestSearchHistory">{
|
||||
"lastFilter": {
|
||||
"state": "OPEN",
|
||||
"assignee": "VerhulstBram"
|
||||
}
|
||||
}</component>
|
||||
<component name="GithubPullRequestsUISettings">{
|
||||
"selectedUrlAndAccountId": {
|
||||
"url": "https://github.com/HowestDAE/dae16-VerhulstBram",
|
||||
"accountId": "10646dff-e3dc-43df-be50-11b78f56b677"
|
||||
}
|
||||
}</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
@@ -42,6 +240,7 @@
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include/algorithm" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include/stdbool.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include/type_traits" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include/vector" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include/xstring" root0="SKIP_HIGHLIGHTING" />
|
||||
@@ -51,7 +250,6 @@
|
||||
<setting file="file://$PROJECT_DIR$/Engine/utils.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Engine/utils.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Game/Camera.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="mock://C:/Users/Bram/Desktop/Programming 2/Exam/dae16-VerhulstBram/Game/Levels/World/Building.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Game/Player.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Game/Player.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Game/pch.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||
@@ -251,6 +449,20 @@
|
||||
<workItem from="1715762731245" duration="3986000" />
|
||||
<workItem from="1715773968873" duration="3580000" />
|
||||
<workItem from="1715814533138" duration="12142000" />
|
||||
<workItem from="1715855980946" duration="322000" />
|
||||
<workItem from="1715869280310" duration="7948000" />
|
||||
<workItem from="1715965257505" duration="20000" />
|
||||
<workItem from="1716027060970" duration="440000" />
|
||||
<workItem from="1716151110346" duration="626000" />
|
||||
<workItem from="1716156590878" duration="604000" />
|
||||
<workItem from="1716243534386" duration="1262000" />
|
||||
<workItem from="1716317489272" duration="2028000" />
|
||||
<workItem from="1716382269867" duration="3045000" />
|
||||
<workItem from="1716414423788" duration="1683000" />
|
||||
<workItem from="1716446779423" duration="24687000" />
|
||||
<workItem from="1716806194636" duration="82000" />
|
||||
<workItem from="1716817512182" duration="4362000" />
|
||||
<workItem from="1716892028109" duration="12355000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Rework Tile detection system">
|
||||
<option name="closed" value="true" />
|
||||
@@ -404,7 +616,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715817878533</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="20" />
|
||||
<task id="LOCAL-00020" summary="Add sun / moon, started on score / GameManager">
|
||||
<option name="closed" value="true" />
|
||||
<created>1715856298231</created>
|
||||
<option name="number" value="00020" />
|
||||
<option name="presentableId" value="LOCAL-00020" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715856298231</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="21" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -432,7 +652,15 @@
|
||||
<MESSAGE value="Started on GuiIcon, General fixes" />
|
||||
<MESSAGE value="Add Particles (basic)" />
|
||||
<MESSAGE value="Add Text rendering and Hull / Fuel Meters" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Add Text rendering and Hull / Fuel Meters" />
|
||||
<MESSAGE value="Add sun / moon, started on score / GameManager" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Add sun / moon, started on score / GameManager" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<watches-manager>
|
||||
<configuration name="CppProject">
|
||||
<watch expression="@ ALREADY PREPROCESSED @m_IsPlayerInHitbox" />
|
||||
</configuration>
|
||||
</watches-manager>
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<expand />
|
||||
|
||||
BIN
Assets/Player/PlayerFly.aseprite
Normal file
BIN
Assets/Player/PlayerFly.aseprite
Normal file
Binary file not shown.
BIN
Assets/Player/PlayerFlyStart.aseprite
Normal file
BIN
Assets/Player/PlayerFlyStart.aseprite
Normal file
Binary file not shown.
BIN
Assets/Player/PlayerFlyTurn.aseprite
Normal file
BIN
Assets/Player/PlayerFlyTurn.aseprite
Normal file
Binary file not shown.
@@ -29,6 +29,10 @@ namespace Collision
|
||||
Vector2f vel;
|
||||
|
||||
std::map<CollisionDirection, CollisionRect*> ContactMap{};
|
||||
|
||||
Rectf getRectf() {
|
||||
return Rectf{ pos.x, pos.y, size.x, size.y };
|
||||
}
|
||||
};
|
||||
|
||||
struct TileCollisionRect
|
||||
|
||||
@@ -2,76 +2,59 @@
|
||||
#include <iostream>
|
||||
#include "SoundEffect.h"
|
||||
|
||||
SoundEffect::SoundEffect( const std::string& path )
|
||||
:m_pMixChunk{ Mix_LoadWAV( path.c_str( ) ) }
|
||||
{
|
||||
if ( m_pMixChunk == nullptr )
|
||||
{
|
||||
const std::string errorMsg = "SoundEffect: Failed to load " + path + ",\nSDL_mixer Error: " + Mix_GetError( );
|
||||
SoundEffect::SoundEffect(const std::string& path, int channel)
|
||||
: m_pMixChunk { Mix_LoadWAV(path.c_str()) }, m_Channel(channel) {
|
||||
if (m_pMixChunk == nullptr) {
|
||||
const std::string errorMsg = "SoundEffect: Failed to load " + path + ",\nSDL_mixer Error: " + Mix_GetError();
|
||||
std::cerr << errorMsg;
|
||||
}
|
||||
}
|
||||
SoundEffect::~SoundEffect( )
|
||||
{
|
||||
Mix_FreeChunk( m_pMixChunk );
|
||||
SoundEffect::~SoundEffect() {
|
||||
Mix_FreeChunk(m_pMixChunk);
|
||||
m_pMixChunk = nullptr;
|
||||
}
|
||||
|
||||
bool SoundEffect::IsLoaded( ) const
|
||||
{
|
||||
bool SoundEffect::IsLoaded() const {
|
||||
return m_pMixChunk != nullptr;
|
||||
}
|
||||
|
||||
bool SoundEffect::Play( const int loops ) const
|
||||
{
|
||||
// Don't save the channel as a data member,
|
||||
// because when it stops playing the channel becomes free
|
||||
// and available for usage by other effects
|
||||
if ( m_pMixChunk != nullptr )
|
||||
{
|
||||
const int channel{ Mix_PlayChannel( -1, m_pMixChunk, loops ) };
|
||||
return channel == -1 ? false : true;
|
||||
void SoundEffect::Play(const int loops) const {
|
||||
if (m_pMixChunk != nullptr) {
|
||||
const int channel { Mix_PlayChannel(m_Channel, m_pMixChunk, loops) };
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
else {
|
||||
std::cout << "SoundEffect::Play() failed, sound effect not loaded\n";
|
||||
}
|
||||
}
|
||||
|
||||
void SoundEffect::SetVolume( const int value )
|
||||
{
|
||||
if ( m_pMixChunk != nullptr )
|
||||
{
|
||||
Mix_VolumeChunk( m_pMixChunk, value );
|
||||
void SoundEffect::SetVolume(const int value) {
|
||||
if (m_pMixChunk != nullptr) {
|
||||
Mix_VolumeChunk(m_pMixChunk, value);
|
||||
}
|
||||
}
|
||||
|
||||
int SoundEffect::GetVolume( ) const
|
||||
{
|
||||
if ( m_pMixChunk != nullptr )
|
||||
{
|
||||
return Mix_VolumeChunk( m_pMixChunk, -1 );
|
||||
int SoundEffect::GetVolume() const {
|
||||
if (m_pMixChunk != nullptr) {
|
||||
return Mix_VolumeChunk(m_pMixChunk, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void SoundEffect::StopAll( )
|
||||
{
|
||||
Mix_HaltChannel(-1 );
|
||||
void SoundEffect::Stop() const {
|
||||
Mix_HaltChannel(m_Channel);
|
||||
}
|
||||
|
||||
void SoundEffect::PauseAll( )
|
||||
{
|
||||
Mix_Pause( -1 );
|
||||
}
|
||||
void SoundEffect::ResumeAll( )
|
||||
{
|
||||
Mix_Resume( -1 );
|
||||
void SoundEffect::StopAll() {
|
||||
Mix_HaltChannel(-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SoundEffect::PauseAll() {
|
||||
Mix_Pause(-1);
|
||||
}
|
||||
void SoundEffect::ResumeAll() {
|
||||
Mix_Resume(-1);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class Mix_Chunk;
|
||||
class SoundEffect final
|
||||
{
|
||||
public:
|
||||
explicit SoundEffect( const std::string& path );
|
||||
explicit SoundEffect( const std::string& path, int channel = -1);
|
||||
~SoundEffect( );
|
||||
SoundEffect(const SoundEffect& other) = delete;
|
||||
SoundEffect& operator=(const SoundEffect& rhs) = delete;
|
||||
@@ -12,13 +12,15 @@ public:
|
||||
SoundEffect& operator=( SoundEffect&& rhs) = delete;
|
||||
|
||||
bool IsLoaded( ) const;
|
||||
bool Play( const int loops ) const;
|
||||
void Play( const int loops ) const;
|
||||
void SetVolume( const int value );
|
||||
int GetVolume( ) const;
|
||||
void Stop( ) const;
|
||||
static void StopAll( );
|
||||
static void PauseAll( );
|
||||
static void ResumeAll( );
|
||||
|
||||
private:
|
||||
Mix_Chunk* m_pMixChunk;
|
||||
int m_Channel;
|
||||
};
|
||||
|
||||
@@ -21,6 +21,9 @@ void Text::Draw(const Vector2f& pos) const {
|
||||
}
|
||||
}
|
||||
void Text::ChangeText(const std::string& text) {
|
||||
if(m_Text == text) {
|
||||
return;
|
||||
}
|
||||
if(m_IsCreatedOk && m_Texture->IsCreationOk()) {
|
||||
delete m_Texture;
|
||||
m_Texture = new Texture(text, m_FontPath, m_Size, m_Color);
|
||||
|
||||
@@ -14,4 +14,5 @@ namespace Colors
|
||||
const Color4f MAGENTA{ 1.0f, 0.0f, 1.0f, 1.0f };
|
||||
const Color4f CYAN{ 0.0f, 1.0f, 1.0f, 1.0f };
|
||||
const Color4f PINK{ 1.0f, 0.0f, 0.5f, 1.0f };
|
||||
const Color4f ORANGE{ 1.0f, 0.5f, 0.0f, 1.0f };
|
||||
}
|
||||
|
||||
@@ -13,16 +13,19 @@ void GameManager::SetMainScreen(MainScreen* pMainScreen) {
|
||||
m_pMainScreen = pMainScreen;
|
||||
//TODO: not the best but ¯\_(ツ)_/¯
|
||||
}
|
||||
void GameManager::SetFuel(int fuel) {
|
||||
void GameManager::SetFuel(float fuel) {
|
||||
m_Fuel = fuel;
|
||||
//Limit to 0 - MAXa
|
||||
|
||||
}
|
||||
int GameManager::GetFuel() const {
|
||||
float GameManager::GetFuel() const {
|
||||
return m_Fuel;
|
||||
}
|
||||
void GameManager::DecreaseFuel(int fuel) {
|
||||
void GameManager::DecreaseFuel(float fuel) {
|
||||
m_Fuel -= fuel;
|
||||
m_Fuel = std::max(0.0f, m_Fuel);
|
||||
}
|
||||
void GameManager::AddFuel(int fuel) {
|
||||
void GameManager::AddFuel(float fuel) {
|
||||
m_Fuel += fuel;
|
||||
}
|
||||
void GameManager::SetHullIntegrity(int hullIntegrity) {
|
||||
@@ -43,8 +46,20 @@ int GameManager::GetScore() const {
|
||||
void GameManager::IncreaseScore(int score) {
|
||||
m_Score += score;
|
||||
}
|
||||
void GameManager::SetMoney(int money) {
|
||||
m_Money = money;
|
||||
}
|
||||
int GameManager::GetMoney() const {
|
||||
return m_Money;
|
||||
}
|
||||
void GameManager::IncreaseMoney(int money) {
|
||||
m_Money += money;
|
||||
}
|
||||
void GameManager::Update(float elapsedSecs) {
|
||||
m_pMainScreen->SetFuelMeterValue(m_Fuel);
|
||||
m_pMainScreen->SetFuelMeterValue(this->GetMaxFuel() - m_Fuel);
|
||||
m_pMainScreen->SetHullMeterValue(m_HullIntegrity);
|
||||
m_pMainScreen->SetScore(std::to_string(m_Score));
|
||||
}
|
||||
int GameManager::GetMaxFuel() {
|
||||
return 100; //TODO: change if i ever add upgrades
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ public:
|
||||
|
||||
void SetMainScreen(MainScreen* pMainScreen);
|
||||
|
||||
void SetFuel(int fuel);
|
||||
int GetFuel() const;
|
||||
void DecreaseFuel(int fuel);
|
||||
void AddFuel(int fuel);
|
||||
void SetFuel(float fuel);
|
||||
float GetFuel() const;
|
||||
void DecreaseFuel(float fuel);
|
||||
void AddFuel(float fuel);
|
||||
|
||||
void SetHullIntegrity(int hullIntegrity);
|
||||
int GetHullIntegrity() const;
|
||||
@@ -23,7 +23,12 @@ public:
|
||||
int GetScore() const;
|
||||
void IncreaseScore(int score);
|
||||
|
||||
void SetMoney(int money);
|
||||
int GetMoney() const;
|
||||
void IncreaseMoney(int money);
|
||||
|
||||
void Update(float elapsedSecs);
|
||||
int GetMaxFuel();
|
||||
|
||||
private:
|
||||
GameManager() = default;
|
||||
@@ -31,8 +36,9 @@ private:
|
||||
|
||||
float m_Balance{ 0.0f };
|
||||
int m_HullIntegrity{ 100 };
|
||||
int m_Fuel{ 100 };
|
||||
float m_Fuel{ 100.0f };
|
||||
int m_Score{ 0 };
|
||||
int m_Money{ 0 };
|
||||
MainScreen* m_pMainScreen{ nullptr };
|
||||
};
|
||||
|
||||
|
||||
@@ -36,20 +36,20 @@ GroundTileType * getRandomGroundTile() {
|
||||
}
|
||||
void InitializeGroundTiles() {
|
||||
Tiles tiles {};
|
||||
GroundTileTypeManager::GetInstance()->AIR = new GroundTileType("", GroundTileTypes::Air);
|
||||
GroundTileTypeManager::GetInstance()->DIRT = new RandomGroundTile("tiles/dirt/dirt[0].png", GroundTileTypes::Dirt, 5);
|
||||
GroundTileTypeManager::GetInstance()->AIR = new GroundTileType("", GroundTileTypes::Air, 0);
|
||||
GroundTileTypeManager::GetInstance()->DIRT = new RandomGroundTile("tiles/dirt/dirt[0].png", GroundTileTypes::Dirt, 5, 250);
|
||||
|
||||
GroundTileTypeManager::GetInstance()->STONE = new RandomGroundTile("tiles/ores/Ore_Stone_[0].png", GroundTileTypes::Stone, 3);
|
||||
GroundTileTypeManager::GetInstance()->LAVA = new RandomGroundTile("tiles/ores/Ore_Lava_[0].png", GroundTileTypes::Lava, 3);
|
||||
GroundTileTypeManager::GetInstance()->STONE = new RandomGroundTile("tiles/ores/Ore_Stone_[0].png", GroundTileTypes::Stone, 3, 0);
|
||||
GroundTileTypeManager::GetInstance()->LAVA = new RandomGroundTile("tiles/ores/Ore_Lava_[0].png", GroundTileTypes::Lava, 3, 0);
|
||||
|
||||
GroundTileTypeManager::GetInstance()->IRON = new GroundTileType("tiles/ores/Ore_Ironium.png", GroundTileTypes::Iron);
|
||||
GroundTileTypeManager::GetInstance()->BRONZE = new GroundTileType("tiles/ores/Ore_Bronzium.png", GroundTileTypes::Bronze);
|
||||
GroundTileTypeManager::GetInstance()->GOLD = new GroundTileType("tiles/ores/Ore_Goldium.png", GroundTileTypes::Gold);
|
||||
GroundTileTypeManager::GetInstance()->IRON = new GroundTileType("tiles/ores/Ore_Ironium.png", GroundTileTypes::Iron, 1500);
|
||||
GroundTileTypeManager::GetInstance()->BRONZE = new GroundTileType("tiles/ores/Ore_Bronzium.png", GroundTileTypes::Bronze, 3000);
|
||||
GroundTileTypeManager::GetInstance()->GOLD = new GroundTileType("tiles/ores/Ore_Goldium.png", GroundTileTypes::Gold, 12500);
|
||||
|
||||
GroundTileTypeManager::GetInstance()->GRASS = new RandomGroundTile("tiles/dirt/special/grass[0].png", GroundTileTypes::Grass, 2);
|
||||
GroundTileTypeManager::GetInstance()->HARD_LEFT = new GroundTileType("tiles/dirt/special/hardLeft.png", GroundTileTypes::Hard);
|
||||
GroundTileTypeManager::GetInstance()->HARD_RIGHT = new GroundTileType("tiles/dirt/special/hardRight.png", GroundTileTypes::Hard);
|
||||
GroundTileTypeManager::GetInstance()->HARD_MIDDLE = new GroundTileType("tiles/dirt/special/hardMiddle.png", GroundTileTypes::Hard);
|
||||
GroundTileTypeManager::GetInstance()->GRASS = new RandomGroundTile("tiles/dirt/special/grass[0].png", GroundTileTypes::Grass, 2, 250);
|
||||
GroundTileTypeManager::GetInstance()->HARD_LEFT = new GroundTileType("tiles/dirt/special/hardLeft.png", GroundTileTypes::Hard, 0);
|
||||
GroundTileTypeManager::GetInstance()->HARD_RIGHT = new GroundTileType("tiles/dirt/special/hardRight.png", GroundTileTypes::Hard, 0);
|
||||
GroundTileTypeManager::GetInstance()->HARD_MIDDLE = new GroundTileType("tiles/dirt/special/hardMiddle.png", GroundTileTypes::Hard, 0);
|
||||
|
||||
GroundTileWeights = {
|
||||
{ GroundTileTypeManager::GetInstance()->AIR, 0.2f },
|
||||
@@ -70,7 +70,7 @@ WorldTile::WorldTile(const Vector2f& position, GroundTileType* groundTileType, T
|
||||
m_GroundTileType { groundTileType }, m_pGridManager { pGridManager } {
|
||||
// const std::string dirtPath = + "tiles/dirt/dirt" + std::to_string(utils::randRange(1, 5)) + ".png";
|
||||
// m_pTexture = new Texture(dirtPath);
|
||||
m_pTexture = pTextureManager->GetTexture(groundTileType->getPath());
|
||||
m_pTexture = pTextureManager->GetTexture(groundTileType->GetPath());
|
||||
|
||||
m_SideTextures[TileDirection::TopLeft] = pTextureManager->GetTexture("tiles/dirt/sidepieces/topLeft.png");
|
||||
m_SideTextures[TileDirection::TopRight] = pTextureManager->GetTexture("tiles/dirt/sidepieces/topRight.png");
|
||||
@@ -90,7 +90,7 @@ WorldTile::~WorldTile() {
|
||||
void WorldTile::Draw() {
|
||||
|
||||
|
||||
switch (m_GroundTileType->getType()) {
|
||||
switch (m_GroundTileType->GetType()) {
|
||||
case GroundTileTypes::Air: {
|
||||
//check if it's all around dirt
|
||||
// bool allDirt = true;
|
||||
@@ -157,17 +157,17 @@ Collision::TileCollisionRect WorldTile::GetCollisionRect() {
|
||||
void WorldTile::DrawSide(const TileDirection& direction) {
|
||||
const WorldTile* tile = m_SurroundingTiles.GetTile(direction);
|
||||
if (tile != nullptr) {
|
||||
const GroundTileTypes type = tile->GetTileType()->getType();
|
||||
const GroundTileTypes type = tile->GetTileType()->GetType();
|
||||
if (direction == TileDirection::BottomMiddle || direction == TileDirection::BottomLeft || direction == TileDirection::BottomRight) {
|
||||
if (type == GroundTileTypeManager::GetInstance()->GRASS->getType() || type == GroundTileTypeManager::GetInstance()->HARD_LEFT->getType() || type ==
|
||||
GroundTileTypeManager::GetInstance()->HARD_MIDDLE->getType() || type == GroundTileTypeManager::GetInstance()->HARD_RIGHT->getType()) {
|
||||
if (type == GroundTileTypeManager::GetInstance()->GRASS->GetType() || type == GroundTileTypeManager::GetInstance()->HARD_LEFT->GetType() || type ==
|
||||
GroundTileTypeManager::GetInstance()->HARD_MIDDLE->GetType() || type == GroundTileTypeManager::GetInstance()->HARD_RIGHT->GetType()) {
|
||||
//Fix for edges being renderd on grass / hard tiles
|
||||
//TODO: Possible fix if i have time
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != GroundTileTypeManager::GetInstance()->AIR->getType()) {
|
||||
if (type != GroundTileTypeManager::GetInstance()->AIR->GetType()) {
|
||||
m_SideTextures[direction]->Draw(m_Position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
class Camera;
|
||||
|
||||
enum class GroundTileTypes
|
||||
{
|
||||
enum class GroundTileTypes {
|
||||
Air,
|
||||
Dirt,
|
||||
Grass,
|
||||
@@ -38,64 +37,67 @@ static std::map<GroundTileTypes, std::string> GroundTileTypeStrings {
|
||||
|
||||
GroundTileType * getRandomGroundTile();
|
||||
|
||||
class GroundTileType
|
||||
{
|
||||
class GroundTileType {
|
||||
public:
|
||||
GroundTileType(const std::string&& filePath, GroundTileTypes type): m_filePath(filePath), m_type(type) {
|
||||
GroundTileType(const std::string&& filePath, GroundTileTypes type, int value): m_FilePath(filePath), m_Type(type), m_Value(value) {
|
||||
}
|
||||
virtual ~GroundTileType() = default;
|
||||
bool operator==(const GroundTileType& rhs) const {
|
||||
return m_type == rhs.m_type;
|
||||
return m_Type == rhs.m_Type;
|
||||
}
|
||||
bool operator!=(const GroundTileType& rhs) const {
|
||||
return m_type != rhs.m_type;
|
||||
return m_Type != rhs.m_Type;
|
||||
}
|
||||
|
||||
virtual bool operator==(const GroundTileType* rhs) const {
|
||||
return rhs->m_type == m_type;
|
||||
return rhs->m_Type == m_Type;
|
||||
}
|
||||
virtual bool operator!=(const GroundTileType* rhs) const {
|
||||
return rhs->m_type != m_type;
|
||||
return rhs->m_Type != m_Type;
|
||||
}
|
||||
|
||||
virtual std::string getPath() const {
|
||||
return m_filePath;
|
||||
virtual std::string GetPath() const {
|
||||
return m_FilePath;
|
||||
}
|
||||
|
||||
virtual GroundTileTypes getType() const {
|
||||
return m_type;
|
||||
virtual GroundTileTypes GetType() const {
|
||||
return m_Type;
|
||||
}
|
||||
|
||||
virtual int GetValue() const {
|
||||
return m_Value;
|
||||
}
|
||||
|
||||
protected:
|
||||
std::string m_filePath;
|
||||
std::string m_FilePath;
|
||||
|
||||
private:
|
||||
GroundTileTypes m_type;
|
||||
GroundTileTypes m_Type;
|
||||
int m_Value;
|
||||
};
|
||||
|
||||
class RandomGroundTile : public GroundTileType
|
||||
{
|
||||
class RandomGroundTile : public GroundTileType {
|
||||
public:
|
||||
RandomGroundTile(const std::string& filePath, GroundTileTypes type, int maxRandom): GroundTileType(std::move(filePath), type), m_maxRandom(maxRandom) {
|
||||
RandomGroundTile(const std::string& filePath, GroundTileTypes type, int maxRandom, int value): GroundTileType(std::move(filePath), type, value), m_maxRandom(maxRandom) {
|
||||
}
|
||||
|
||||
~RandomGroundTile() override = default;
|
||||
|
||||
bool operator==(const GroundTileType* rhs) const override {
|
||||
return rhs->getType() == this->getType();
|
||||
return rhs->GetType() == this->GetType();
|
||||
}
|
||||
|
||||
bool operator!=(const GroundTileType* rhs) const override {
|
||||
return rhs->getType() != this->getType();
|
||||
return rhs->GetType() != this->GetType();
|
||||
}
|
||||
|
||||
std::string getPath() const override {
|
||||
std::string GetPath() const override {
|
||||
int variant = utils::randRange(1, m_maxRandom);
|
||||
std::string toReplace { "[0]" };
|
||||
std::string replacement = std::to_string(utils::randRange(1, m_maxRandom));
|
||||
|
||||
size_t found = m_filePath.find(toReplace);
|
||||
std::string newFilePath { m_filePath };
|
||||
size_t found = m_FilePath.find(toReplace);
|
||||
std::string newFilePath { m_FilePath };
|
||||
|
||||
if (found != std::string::npos) {
|
||||
newFilePath.replace(found, 3, replacement);
|
||||
@@ -108,8 +110,7 @@ private:
|
||||
int m_maxRandom;
|
||||
};
|
||||
|
||||
class Tiles
|
||||
{
|
||||
class Tiles {
|
||||
public:
|
||||
|
||||
};
|
||||
@@ -128,12 +129,11 @@ public:
|
||||
// { Tiles::Ores::IRON, 0.1f },
|
||||
// };
|
||||
|
||||
static std::map<GroundTileType*, float> GroundTileWeights;
|
||||
static std::map<GroundTileType *, float> GroundTileWeights;
|
||||
|
||||
void InitializeGroundTiles();
|
||||
|
||||
class WorldTile
|
||||
{
|
||||
class WorldTile {
|
||||
public:
|
||||
WorldTile() = default;
|
||||
WorldTile(const Vector2f& position, GroundTileType* groundTileType, TextureManager* pTextureManager, WorldGridManager* pGridManager);
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
}
|
||||
void SetTileType(GroundTileType* type) {
|
||||
m_GroundTileType = type;
|
||||
m_pTexture = TextureManager::GetInstance()->GetTexture(type->getPath()); //Chage the texture when setting a new type
|
||||
m_pTexture = TextureManager::GetInstance()->GetTexture(type->GetPath()); //Chage the texture when setting a new type
|
||||
}
|
||||
|
||||
Collision::TileCollisionRect GetCollisionRect();
|
||||
@@ -179,7 +179,7 @@ private:
|
||||
|
||||
surroundingTiles m_SurroundingTiles;
|
||||
|
||||
std::vector<Texture*> m_SideTextures { 8, nullptr };
|
||||
std::vector<Texture *> m_SideTextures { 8, nullptr };
|
||||
|
||||
Texture* m_pAllTexture;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,6 @@ void GuiMeter::Draw() const {
|
||||
utils::DrawRect(Rectf { m_Position, m_DrawSize});
|
||||
}
|
||||
void GuiMeter::Update(float elapsedSec) {
|
||||
m_Value += 1;
|
||||
const int frame = static_cast<int>(utils::map(m_Value, 0.0f, m_MaxValue, 0, (float)m_Animation->GetFrameCount()));
|
||||
m_Animation->SetFrame(frame);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ void GuiText::Update(float elapsedSec) {
|
||||
|
||||
void GuiText::ChangeText(const std::string& text) const {
|
||||
m_Text->ChangeText(text);
|
||||
|
||||
}
|
||||
GuiText::~GuiText() {
|
||||
delete m_Text;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "pch.h"
|
||||
#include "FuelScreen.h"
|
||||
|
||||
#include "colors.h"
|
||||
#include "GameManager.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "utils.h"
|
||||
FuelScreen::FuelScreen(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager): Screen(filePath, pos, size, manager)
|
||||
@@ -39,13 +41,32 @@ FuelScreen::FuelScreen(const std::string& filePath, Vector2f pos, Vector2f size,
|
||||
GuiButton* fillTankButton = new GuiButton { "gui/fuel/fillTank.png", fillTankButtonPos, Vector2f{0,0}, TextureManager::GetInstance() };
|
||||
this->AddElement(fillTankButton);
|
||||
|
||||
|
||||
Vector2f offset{ 50, 320};
|
||||
m_MoneyText = new GuiText {fuelScreenCenter + offset, "$ 20", "fonts/Arial.ttf", 20, Colors::YELLOW };
|
||||
|
||||
}
|
||||
|
||||
FuelScreen::~FuelScreen() = default;
|
||||
FuelScreen::~FuelScreen() {
|
||||
delete m_MoneyText;
|
||||
};
|
||||
|
||||
void FuelScreen::Draw() const {
|
||||
|
||||
int currentFuel = GameManager::GetInstance().GetFuel();
|
||||
int maxFuel = GameManager::GetInstance().GetMaxFuel();
|
||||
|
||||
utils::SetColor(Colors::ORANGE);
|
||||
Vector2f fuelBarPos = Vector2f { 275, 135 };
|
||||
const int MAX_HEIGHT = 210;
|
||||
Vector2f fuelBarSize = Vector2f { 40, utils::map(currentFuel, 0, maxFuel, 0, MAX_HEIGHT) };
|
||||
utils::FillRect(Rectf{fuelBarPos, fuelBarSize});
|
||||
|
||||
Screen::Draw();
|
||||
m_MoneyText->Draw();
|
||||
|
||||
}
|
||||
void FuelScreen::Update(float elapsedSecs) {
|
||||
Screen::Update(elapsedSecs);
|
||||
m_MoneyText->ChangeText("$ " + std::to_string(GameManager::GetInstance().GetMoney()));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "../Screen.h"
|
||||
#include "Gui/GuiText.h"
|
||||
|
||||
class FuelScreen : public Screen
|
||||
{
|
||||
@@ -11,4 +12,7 @@ public:
|
||||
virtual void Draw() const override;
|
||||
virtual void Update(float elapsedSecs) override;
|
||||
|
||||
private:
|
||||
GuiText* m_MoneyText;
|
||||
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "MainScreen.h"
|
||||
|
||||
#include "colors.h"
|
||||
#include "GameManager.h"
|
||||
#include "utils.h"
|
||||
#include "Gui/GuiText.h"
|
||||
MainScreen::MainScreen(TextureManager* manager) : Screen("", Vector2f{0, 0}, Vector2f{900.f, 500.f}, manager) {
|
||||
|
||||
@@ -37,6 +37,9 @@ void ScreenManager::CloseScreen() {
|
||||
}
|
||||
|
||||
}
|
||||
bool ScreenManager::IsScreenOpen() {
|
||||
return m_IsScreenOpen;
|
||||
}
|
||||
ScreenManager::~ScreenManager() {
|
||||
delete m_FuelScreen;
|
||||
delete m_SellScreen;
|
||||
|
||||
@@ -13,6 +13,7 @@ public:
|
||||
void CloseScreen();
|
||||
|
||||
Screen* GetCurrentScreen() const { return m_currentScreen; }
|
||||
bool IsScreenOpen();
|
||||
|
||||
static ScreenManager* m_pInstance;
|
||||
|
||||
|
||||
@@ -2,14 +2,48 @@
|
||||
#include "Building.h"
|
||||
|
||||
#include <iostream>
|
||||
Building::Building(const std::string& filePath, const Vector2f& position, TextureManager* pTextureManager): m_Position(position) {
|
||||
#include <utility>
|
||||
|
||||
#include "colors.h"
|
||||
#include "utils.h"
|
||||
Building::Building(const std::string& filePath, const Vector2f& position, const Rectf& boundingBox, TextureManager* pTextureManager): m_Position(position),
|
||||
m_BoundingBox(boundingBox) {
|
||||
m_Texture = pTextureManager->GetTexture(filePath);
|
||||
m_Size = Vector2f(m_Texture->GetWidth(), m_Texture->GetHeight());
|
||||
std::cout << "i like kids" << std::endl;
|
||||
}
|
||||
Building::~Building() = default;
|
||||
|
||||
void Building::Draw() const {
|
||||
m_Texture->Draw(m_Position);
|
||||
utils::SetColor(Colors::GREEN);
|
||||
Rectf temp = m_BoundingBox;
|
||||
temp.left += m_Position.x;
|
||||
temp.bottom += m_Position.y;
|
||||
utils::DrawRect(temp);
|
||||
}
|
||||
void Building::Update(float dt) {
|
||||
void Building::Update(float dt, const Rectf& objectBoundingBox) {
|
||||
if (IsObjectInHitbox(objectBoundingBox)) {
|
||||
if (!m_IsPlayerInHitbox) { //TODO: what
|
||||
m_IsPlayerInHitbox = true;
|
||||
if (m_OnEnterHitbox != nullptr) {
|
||||
m_OnEnterHitbox();
|
||||
}
|
||||
else {
|
||||
std::cout << "No function set for onEnterHitbox" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_IsPlayerInHitbox = false;
|
||||
}
|
||||
}
|
||||
void Building::SetOnEnterHitbox(std::function<void()> onEnterHitbox) {
|
||||
m_OnEnterHitbox = std::move(onEnterHitbox);
|
||||
}
|
||||
bool Building::IsObjectInHitbox(const Rectf& objectBoundingBox) const {
|
||||
Rectf temp = m_BoundingBox;
|
||||
temp.left += m_Position.x;
|
||||
temp.bottom += m_Position.y;
|
||||
return utils::IsRectInRect(objectBoundingBox, temp);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,34 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
|
||||
#include "Texture.h"
|
||||
#include "TextureManager.h"
|
||||
|
||||
class Building
|
||||
{
|
||||
public:
|
||||
Building(const std::string& filePath, const Vector2f& position, TextureManager* pTextureManager);
|
||||
Building(const Building& other) = default;
|
||||
Building(Building&& other) = default;
|
||||
Building& operator=(const Building& other) = default;
|
||||
Building& operator=(Building&& other) = default;
|
||||
Building(const std::string& filePath, const Vector2f& position, const Rectf& boundingBox, TextureManager* pTextureManager);
|
||||
// Building(const Building& other) = default;
|
||||
// Building(Building&& other) = default;
|
||||
// Building& operator=(const Building& other) = default;
|
||||
// Building& operator=(Building&& other) = default;
|
||||
|
||||
~Building();
|
||||
|
||||
void Draw() const;
|
||||
void Update(float dt);
|
||||
void Update(float dt, const Rectf& objectBoundingBox);
|
||||
|
||||
void SetOnEnterHitbox(std::function<void(void)> onEnterHitbox);
|
||||
|
||||
private:
|
||||
bool IsObjectInHitbox(const Rectf& objectBoundingBox) const;
|
||||
|
||||
Texture* m_Texture;
|
||||
Vector2f m_Position;
|
||||
Vector2f m_Size;
|
||||
|
||||
Rectf m_boundingBox;
|
||||
|
||||
Rectf m_BoundingBox;
|
||||
std::function<void(void)> m_OnEnterHitbox;
|
||||
bool m_IsPlayerInHitbox{ false };
|
||||
bool m_DidPlayerEnterHitbox{ false };
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "Collision.h"
|
||||
#include "colors.h"
|
||||
#include "GameManager.h"
|
||||
#include "../../GridSystem/GroundTileTypeManager.h"
|
||||
#include "utils.h"
|
||||
#include "GridSystem/WorldTile.h"
|
||||
@@ -35,13 +36,18 @@ WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera),
|
||||
m_GridManager.GetTileAtIndex(x, 0)->SetTileType(GroundTileTypeManager::GetInstance()->AIR);
|
||||
m_GridManager.GetTileAtIndex(x, 1)->SetTileType(GroundTileTypeManager::GetInstance()->GRASS);
|
||||
}
|
||||
m_Buildings.emplace_back(Building { "buildings/fuelStation.png", Vector2f { -700, -52 }, TextureManager::GetInstance() });
|
||||
Building* fuelBuilding = new Building { "buildings/fuelStation.png", Vector2f { -700, -52 }, Rectf{0 ,0, 50, 50}, TextureManager::GetInstance() };
|
||||
fuelBuilding->SetOnEnterHitbox([]() {
|
||||
ScreenManager::GetInstance()->OpenScreen(ScreenManager::m_FuelScreen);
|
||||
});
|
||||
m_Buildings.push_back(fuelBuilding);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f { -750, -50 })->SetTileType(GroundTileTypeManager::GetInstance()->HARD_LEFT);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f { -700, -50 })->SetTileType(GroundTileTypeManager::GetInstance()->HARD_LEFT);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f { -700, -50 })->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f { -650, -50 })->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f { -600, -50 })->SetTileType(GroundTileTypeManager::GetInstance()->HARD_RIGHT);
|
||||
|
||||
m_Buildings.emplace_back(Building { "buildings/mineralStation.png", Vector2f { -350, -52 }, TextureManager::GetInstance() });
|
||||
|
||||
m_Buildings.emplace_back(new Building { "buildings/mineralStation.png", Vector2f { -350, -52 }, Rectf{0 ,0, 100, 100}, TextureManager::GetInstance() });
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {-400, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_LEFT);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {-350, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {-300, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
@@ -49,7 +55,7 @@ WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera),
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {-200, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {-150, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_RIGHT);
|
||||
|
||||
m_Buildings.emplace_back(Building { "buildings/junkStation.png", Vector2f { 250, -52 }, TextureManager::GetInstance() });
|
||||
m_Buildings.emplace_back(new Building { "buildings/junkStation.png", Vector2f { 250, -52 }, Rectf{0 ,0, 100, 100}, TextureManager::GetInstance() });
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {200, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_LEFT);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {250, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {300, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
@@ -57,22 +63,29 @@ WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera),
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {400, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {450, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_RIGHT);
|
||||
|
||||
m_Buildings.emplace_back(Building { "buildings/repairStation.png", Vector2f { 700, -52 }, TextureManager::GetInstance() });
|
||||
m_Buildings.emplace_back(new Building { "buildings/repairStation.png", Vector2f { 700, -52 }, Rectf{0 ,0, 100, 100}, TextureManager::GetInstance() });
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {650, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_LEFT);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {700, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {750, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_MIDDLE);
|
||||
m_GridManager.GetTileAtWorldPos(Vector2f {800, -50})->SetTileType(GroundTileTypeManager::GetInstance()->HARD_RIGHT);
|
||||
// Texture* test = new Texture("gui/main/fuel_guage.png");
|
||||
|
||||
|
||||
m_topCover = TextureManager::GetInstance()->GetTexture("topBackground.png");
|
||||
|
||||
m_MainScreen = new MainScreen(TextureManager::GetInstance());
|
||||
GameManager::GetInstance().SetMainScreen(m_MainScreen);
|
||||
|
||||
m_Sun = new OrbitingObject(Vector2f{0, -1000}, 1200, 0.5f, TextureManager::GetInstance()->GetTexture("sun.png"));
|
||||
m_Moon = new OrbitingObject(Vector2f{0, -1000}, 1200, 0.5f, TextureManager::GetInstance()->GetTexture("moon.png"), M_PI);
|
||||
|
||||
GameManager::GetInstance().SetFuel(100);
|
||||
GameManager::GetInstance().SetHullIntegrity(100);
|
||||
}
|
||||
WorldLevel::~WorldLevel() {
|
||||
delete m_MainScreen;
|
||||
|
||||
delete m_Sun;
|
||||
delete m_Moon;
|
||||
}
|
||||
void WorldLevel::Update(float elapsedSec) {
|
||||
m_Fps = 1 / elapsedSec;
|
||||
@@ -102,8 +115,9 @@ void WorldLevel::Update(float elapsedSec) {
|
||||
}
|
||||
}
|
||||
|
||||
for (Building building : m_Buildings) {
|
||||
building.Update(elapsedSec);
|
||||
for (Building* building : m_Buildings) {
|
||||
building->Update(elapsedSec, m_Player.GetCollisionRect().getRectf());
|
||||
// building.IsPlayerInHitbox(Rectf{m_Player.GetCollisionRect().pos, m_Player.GetCollisionRect().size});
|
||||
}
|
||||
|
||||
|
||||
@@ -112,8 +126,9 @@ void WorldLevel::Update(float elapsedSec) {
|
||||
m_pSelectedTile->SetTileType(GroundTileTypeManager::GetInstance()->AIR);
|
||||
}
|
||||
}
|
||||
|
||||
if(!m_ScreenManager->IsScreenOpen()) {
|
||||
m_Player.Update(elapsedSec, *this);
|
||||
}
|
||||
|
||||
//Move the camera when the player gets to the edge
|
||||
if(m_FollowPlayer) {
|
||||
@@ -139,8 +154,14 @@ void WorldLevel::Update(float elapsedSec) {
|
||||
screen->Update(elapsedSec);
|
||||
}
|
||||
|
||||
m_MainScreen->Update(elapsedSec);
|
||||
GameManager::GetInstance().Update(elapsedSec);
|
||||
m_MainScreen->SetDepth(std::to_string((int)-m_Player.GetPosition().y - 50) + " ft.");
|
||||
m_MainScreen->SetScore("Score: " + std::to_string(GameManager::GetInstance().GetScore()));
|
||||
// m_MainScreen->SetFuelMeterValue(GameManager::GetInstance().GetFuel());
|
||||
// m_MainScreen->SetHullMeterValue(GameManager::GetInstance().GetHullIntegrity());
|
||||
m_MainScreen->Update(elapsedSec);
|
||||
|
||||
|
||||
|
||||
//Vector2f playerPos = m_player.GetPosition();
|
||||
//Vector2f newCameraPos = playerPos;
|
||||
@@ -152,6 +173,10 @@ void WorldLevel::Update(float elapsedSec) {
|
||||
void WorldLevel::Draw() const {
|
||||
|
||||
m_pCamera->BeginRendering();
|
||||
|
||||
m_Sun->Draw();
|
||||
m_Moon->Draw();
|
||||
|
||||
// m_topCover->Draw(Vector2f{-850,-70} );
|
||||
m_topCover->Draw(Rectf{-850, -70, 850, -70 + 32}, Rectf{0, 0, WORLD_WIDTH * 50, 32});
|
||||
|
||||
@@ -175,8 +200,8 @@ void WorldLevel::Draw() const {
|
||||
m_pSelectedTile->Draw();
|
||||
}
|
||||
|
||||
for(Building building : m_Buildings) {
|
||||
building.Draw();
|
||||
for(Building* building : m_Buildings) {
|
||||
building->Draw();
|
||||
}
|
||||
|
||||
m_Player.Draw();
|
||||
@@ -184,9 +209,6 @@ void WorldLevel::Draw() const {
|
||||
utils::SetColor(Colors::GREEN);
|
||||
utils::DrawArrow(Vector2f{0, 0}, m_MousePos);
|
||||
|
||||
m_Sun->Draw();
|
||||
m_Moon->Draw();
|
||||
|
||||
m_pCamera->EndRendering();
|
||||
|
||||
utils::FillRect(utils::GetMousePos(), 10, 10);
|
||||
@@ -209,7 +231,7 @@ void WorldLevel::ProcessImGui() {
|
||||
ImGui::Begin("Selected Tile");
|
||||
std::string tileType = "None";
|
||||
if (m_pSelectedTile != nullptr) {
|
||||
switch (m_pSelectedTile->GetTileType()->getType()) {
|
||||
switch (m_pSelectedTile->GetTileType()->GetType()) {
|
||||
case GroundTileTypes::Air:
|
||||
tileType = "Air";
|
||||
break;
|
||||
@@ -243,6 +265,9 @@ void WorldLevel::ProcessImGui() {
|
||||
if (ImGui::MenuItem("Player Info")) {
|
||||
m_ShowPlayerInfo = !m_ShowPlayerInfo;
|
||||
}
|
||||
if(ImGui::MenuItem("Game Manager Info")) {
|
||||
m_ShowGameManagerInfo = !m_ShowGameManagerInfo;
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
if (ImGui::BeginMenu("Screens")) {
|
||||
@@ -302,6 +327,26 @@ void WorldLevel::ProcessImGui() {
|
||||
ImGui::End();
|
||||
m_Player.ProcessImGui();
|
||||
}
|
||||
|
||||
if(m_ShowGameManagerInfo) {
|
||||
ImGui::Begin("Game Manager", &m_ShowGameManagerInfo, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
ImGui::Text("Fuel: %f", GameManager::GetInstance().GetFuel());
|
||||
ImGui::Text("Hull Integrity: %d", GameManager::GetInstance().GetHullIntegrity());
|
||||
ImGui::Text("Score: %d", GameManager::GetInstance().GetScore());
|
||||
ImGui::Text("Money: %d", GameManager::GetInstance().GetMoney());
|
||||
ImGui::Separator();
|
||||
if(ImGui::Button("Add 1$")) {
|
||||
GameManager::GetInstance().IncreaseMoney(1);
|
||||
}
|
||||
if(ImGui::Button("Add 10$")) {
|
||||
GameManager::GetInstance().IncreaseMoney(10);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Button("Add 100$")) {
|
||||
GameManager::GetInstance().IncreaseMoney(100);
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
WorldGridManager& WorldLevel::GetGridManager() {
|
||||
return m_GridManager;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Gui/Screens/ScreenManager.h"
|
||||
#include "Camera.h"
|
||||
#include "OrbitingObject.h"
|
||||
#include "SoundEffect.h"
|
||||
#include "Text.h"
|
||||
#include "Gui/GuiMeter.h"
|
||||
#include "Gui/Screens/MainScreen.h"
|
||||
@@ -45,7 +46,7 @@ private:
|
||||
|
||||
WorldTile* m_pSelectedTile { nullptr };
|
||||
|
||||
std::vector<Building> m_Buildings{};
|
||||
std::vector<Building*> m_Buildings{};
|
||||
|
||||
|
||||
MainScreen* m_MainScreen{};
|
||||
@@ -55,10 +56,12 @@ private:
|
||||
|
||||
Texture* m_topCover{ nullptr };
|
||||
|
||||
|
||||
// ImGui Vars
|
||||
bool m_ShowTextureManagerWindow { false };
|
||||
bool m_ShowCameraWindow { false };
|
||||
bool m_ShowPlayerInfo { true };
|
||||
bool m_ShowGameManagerInfo{ true };
|
||||
|
||||
bool m_FollowPlayer { true };
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "colors.h"
|
||||
#include "GameManager.h"
|
||||
#include "GridSystem/GroundTileTypeManager.h"
|
||||
#include "utils.h"
|
||||
#include "Levels/World/WorldLevel.h"
|
||||
@@ -30,6 +31,18 @@ Player::Player(const Vector2f& Position, TextureManager* manager) : m_Position(P
|
||||
manager->GetTexture("animations/player/player_dig.png"),
|
||||
7, 0.05f, Rectf { 0, 0, 70, 70 }, true);
|
||||
|
||||
m_flyStartAnimation = new Animation(
|
||||
manager->GetTexture("animations/player/player_fly_start.png"),
|
||||
12, 0.05f, Rectf { 0, 0, 70, 70 }, false);
|
||||
|
||||
m_flyAnimation = new Animation(
|
||||
manager->GetTexture("animations/player/player_fly.png"),
|
||||
5, 0.01f, Rectf { 0, 0, 70, 70 }, true);
|
||||
|
||||
m_flyTurnAnimation = new Animation(
|
||||
manager->GetTexture("animations/player/player_fly_turn.png"),
|
||||
3, 0.05f, Rectf { 0, 0, 70, 70 }, false);
|
||||
|
||||
m_currentAnimation = m_walkAnimation;
|
||||
}
|
||||
Player::Player(Player&& other) {
|
||||
@@ -41,6 +54,10 @@ Player::~Player() {
|
||||
delete m_turnAnimation;
|
||||
delete m_digAnimation;
|
||||
delete m_digStartAnimation;
|
||||
|
||||
delete m_flyStartAnimation;
|
||||
delete m_flyAnimation;
|
||||
delete m_flyTurnAnimation;
|
||||
}
|
||||
|
||||
Collision::CollisionRect Player::GetCollisionRect() const {
|
||||
@@ -59,7 +76,7 @@ void Player::Draw() const {
|
||||
int halfFrameWidth = frameWidth / 2;
|
||||
int bobOffset = m_BobUp ? 1 : 0;
|
||||
|
||||
float rotateOffset = std::abs(m_Vel.x) / 40;
|
||||
float rotateOffset = std::abs(m_Vel.x) / 30;
|
||||
Vector2f drawPos = Vector2f { center.x, center.y + 9 + bobOffset };
|
||||
glPushMatrix();
|
||||
glTranslatef(drawPos.x - halfFrameWidth, drawPos.y - halfFrameWidth, 0);
|
||||
@@ -123,6 +140,12 @@ void Player::ProcessImGui() {
|
||||
ImGui::Text("Bottom: %s", m_ContactMap[Collision::CollisionDirection::Bottom] != nullptr ? "true" : "false");
|
||||
ImGui::Text("Left: %s", m_ContactMap[Collision::CollisionDirection::Left] != nullptr ? "true" : "false");
|
||||
ImGui::Text("Right: %s", m_ContactMap[Collision::CollisionDirection::Right] != nullptr ? "true" : "false");
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::Text("Values");
|
||||
ImGui::Text("Current Fuel: %f", GameManager::GetInstance().GetFuel());
|
||||
ImGui::Text("Current Score: %d", GameManager::GetInstance().GetScore());
|
||||
ImGui::Text("Current Hull Integrity: %d", GameManager::GetInstance().GetHullIntegrity());
|
||||
ImGui::End();
|
||||
}
|
||||
void Player::Dig(Collision::CollisionDirection dir, WorldLevel& level) {
|
||||
@@ -131,6 +154,7 @@ void Player::Dig(Collision::CollisionDirection dir, WorldLevel& level) {
|
||||
m_DigTile = m_ContactMap[dir];
|
||||
//Set the digging location in the center of the destination tile;
|
||||
const WorldTile* tile = m_ContactMap[dir];
|
||||
m_ToAddPoints = tile->GetTileType()->GetValue();
|
||||
//Add case for bottom because otherwise i clip through the floor
|
||||
m_DigDestination = tile->GetPosition();
|
||||
if (dir == Collision::Bottom) {
|
||||
@@ -183,7 +207,14 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
if (m_State != PlayerState::Digging) {
|
||||
if (utils::isKeyDown(SDL_SCANCODE_W)) {
|
||||
m_State = PlayerState::Flying;
|
||||
m_Vel.y = m_Speed;
|
||||
// m_Vel.y = m_Speed / 10;
|
||||
m_Acc.y += m_Speed * 10;
|
||||
if(!m_IsPropellorDeployed) {
|
||||
m_currentAnimation = m_flyStartAnimation;
|
||||
m_flyStartAnimation->SetFlipped(m_Direction == PlayerDirection::Right);
|
||||
} else {
|
||||
m_currentAnimation = m_flyAnimation;
|
||||
}
|
||||
m_Grounded = false;
|
||||
}
|
||||
if (utils::isKeyPressed(SDL_SCANCODE_S)) {
|
||||
@@ -200,11 +231,12 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
if (utils::isKeyDown(SDL_SCANCODE_A)) {
|
||||
if (!m_IsTurning) {
|
||||
m_walkAnimation->SetFlipped(false);
|
||||
m_flyAnimation->SetFlipped(false);
|
||||
}
|
||||
m_Acc.x = -m_Speed;
|
||||
if (m_Direction == PlayerDirection::Right) {
|
||||
m_IsTurning = true;
|
||||
m_currentAnimation = m_turnAnimation;
|
||||
m_currentAnimation = m_State == PlayerState::Walking ? m_turnAnimation : m_flyTurnAnimation;
|
||||
m_currentAnimation->SetFlipped(true);
|
||||
m_currentAnimation->Reset();
|
||||
}
|
||||
@@ -227,12 +259,13 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
if (utils::isKeyDown(SDL_SCANCODE_D)) {
|
||||
if (!m_IsTurning) {
|
||||
m_walkAnimation->SetFlipped(true);
|
||||
m_flyAnimation->SetFlipped(true);
|
||||
}
|
||||
m_Acc.x = m_Speed;
|
||||
|
||||
if (m_Direction == PlayerDirection::Left) {
|
||||
m_IsTurning = true;
|
||||
m_currentAnimation = m_turnAnimation;
|
||||
m_currentAnimation = m_State == PlayerState::Walking ? m_turnAnimation : m_flyTurnAnimation;
|
||||
m_currentAnimation->SetFlipped(false);
|
||||
m_currentAnimation->Reset();
|
||||
}
|
||||
@@ -268,11 +301,30 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
|
||||
m_currentAnimation->Update(elapsedTime);
|
||||
|
||||
if (m_currentAnimation->IsDone() && m_IsTurning) {
|
||||
if(m_State == PlayerState::Flying && m_Grounded) {
|
||||
m_State = PlayerState::Idle;
|
||||
m_walkAnimation->SetFlipped(m_Direction == PlayerDirection::Right);
|
||||
m_currentAnimation = m_walkAnimation;
|
||||
m_IsPropellorDeployed = false;
|
||||
m_flyStartAnimation->Reset();
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (m_currentAnimation->IsDone() && m_IsTurning) {
|
||||
m_currentAnimation = m_State == PlayerState::Walking ? m_walkAnimation : m_flyAnimation;
|
||||
m_IsTurning = false;
|
||||
}
|
||||
|
||||
if(m_currentAnimation == m_flyStartAnimation) {
|
||||
if(m_flyStartAnimation->IsDone()) {
|
||||
m_IsPropellorDeployed = true;
|
||||
m_currentAnimation = m_flyAnimation;
|
||||
} else {
|
||||
m_currentAnimation = m_flyStartAnimation;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_currentAnimation == m_digStartAnimation) {
|
||||
|
||||
@@ -361,9 +413,11 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
switch (m_State) {
|
||||
case PlayerState::Idle:
|
||||
m_walkAnimation->SetPlaying(false);
|
||||
GameManager::GetInstance().DecreaseFuel(0.02f);
|
||||
break;
|
||||
case PlayerState::Walking:
|
||||
m_walkAnimation->SetPlaying(true);
|
||||
GameManager::GetInstance().DecreaseFuel(0.04f);
|
||||
break;
|
||||
case PlayerState::Digging: {
|
||||
// m_walkAnimation->SetPlaying(false);
|
||||
@@ -386,8 +440,8 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
float progress = utils::map(m_DigProgress, 0.0f, m_DigTime, 0.0f, 1.0f);
|
||||
int particleProgress = (int)utils::map(m_DigProgress, 0.0f, m_DigTime, 0.0f, 100.0f);
|
||||
std::cout << progress << '\n';
|
||||
if (particleProgress % 25 == 0) {
|
||||
m_DigParticles.push_back(new Particle(m_Position, Vector2f { (float)utils::randRange(-200, 200), (float)utils::randRange(-100, -300) }, 5.f,
|
||||
if (particleProgress % 2 == 0) {
|
||||
m_DigParticles.push_back(new Particle(m_Position + Vector2f{ 20, 0 }, Vector2f { (float)utils::randRange(-200, 200), (float)utils::randRange(-100, -300) }, 5.f,
|
||||
TextureManager::GetInstance()->GetTexture("particles/dirt_" + std::to_string(utils::randRange(1, 8)) + ".png")));
|
||||
}
|
||||
m_Position = utils::lerp(m_DigStart, m_DigDestination, progress);
|
||||
@@ -401,6 +455,8 @@ void Player::Update(float elapsedTime, WorldLevel& level) {
|
||||
m_currentAnimation = m_walkAnimation;
|
||||
m_HasDeletedTile = false;
|
||||
m_Digging = false;
|
||||
GameManager::GetInstance().IncreaseScore(m_ToAddPoints);
|
||||
m_ToAddPoints = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ private:
|
||||
bool m_HasDeletedTile{ false };
|
||||
WorldTile* m_DigTile{ nullptr };
|
||||
|
||||
int m_ToAddPoints{ 0 };
|
||||
|
||||
bool m_IsDiggingPrimed{ false };
|
||||
|
||||
std::vector<Particle*> m_DigParticles{};
|
||||
@@ -111,6 +113,11 @@ private:
|
||||
Animation* m_digStartAnimation{ nullptr };
|
||||
Animation* m_digAnimation{ nullptr };
|
||||
|
||||
Animation* m_flyStartAnimation{ nullptr };
|
||||
Animation* m_flyAnimation{ nullptr };
|
||||
Animation* m_flyTurnAnimation{ nullptr };
|
||||
bool m_IsPropellorDeployed{ false };
|
||||
|
||||
PlayerState m_State { PlayerState::Idle };
|
||||
PlayerDirection m_Direction { PlayerDirection::Left };
|
||||
DigDirection m_DigDirection { DigDirection::Right };
|
||||
|
||||
BIN
Resources/animations/player/player_fly.png
Normal file
BIN
Resources/animations/player/player_fly.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
BIN
Resources/animations/player/player_fly_start.png
Normal file
BIN
Resources/animations/player/player_fly_start.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
Resources/animations/player/player_fly_turn.png
Normal file
BIN
Resources/animations/player/player_fly_turn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 281 KiB |
BIN
Resources/smb_gameover.wav
Normal file
BIN
Resources/smb_gameover.wav
Normal file
Binary file not shown.
Reference in New Issue
Block a user