diff --git a/Crawler/ConnectionPoint.cpp b/Crawler/ConnectionPoint.cpp
new file mode 100644
index 00000000..f675fdbd
--- /dev/null
+++ b/Crawler/ConnectionPoint.cpp
@@ -0,0 +1,11 @@
+#include "State_OverworldMap.h"
+
+bool ConnectionPoint::IsNeighbor(ConnectionPoint&testPoint){
+ for(int neighbor:neighbors){
+ if(neighbor!=-1){
+ ConnectionPoint&neighborCp=State_OverworldMap::ConnectionPointFromIndex(neighbor);
+ if(&neighborCp==&testPoint)return true;
+ }
+ }
+ return false;
+}
\ No newline at end of file
diff --git a/Crawler/ConnectionPoint.h b/Crawler/ConnectionPoint.h
index 18526869..7ad6effb 100644
--- a/Crawler/ConnectionPoint.h
+++ b/Crawler/ConnectionPoint.h
@@ -11,4 +11,5 @@ struct ConnectionPoint{
:rect(rect),name(name),map(map),unlockCondition(unlockCondition){
neighbors.fill(-1);
}
+ bool IsNeighbor(ConnectionPoint&testPoint);
};
diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp
index dd6ad9e5..65304675 100644
--- a/Crawler/Crawler.cpp
+++ b/Crawler/Crawler.cpp
@@ -387,15 +387,17 @@ void Crawler::HandleUserInput(float fElapsedTime){
void Crawler::UpdateCamera(float fElapsedTime){
lastWorldShakeAdjust=std::max(0.f,lastWorldShakeAdjust-fElapsedTime);
- if(worldShakeTime-fElapsedTime>0){
+ if(worldShakeTime>0){
+ worldShakeTime-=fElapsedTime;
+ if(worldShakeTime<=0){
+ camera.SetTarget(player->GetPos());
+ }
if(lastWorldShakeAdjust==0){
lastWorldShakeAdjust=0.02;
worldShakeVel.x*=-1;
worldShakeVel.y*=-1;
}
worldShake=player->GetPos()+worldShakeVel;
- }else{
- camera.SetTarget(player->GetPos());
}
worldShakeTime=std::max(0.f,worldShakeTime-fElapsedTime);
camera.Update(fElapsedTime);
diff --git a/Crawler/Crawler.vcxproj b/Crawler/Crawler.vcxproj
index 15f7ff57..9348bae0 100644
--- a/Crawler/Crawler.vcxproj
+++ b/Crawler/Crawler.vcxproj
@@ -323,6 +323,7 @@
+
@@ -342,7 +343,6 @@
-
diff --git a/Crawler/Crawler.vcxproj.filters b/Crawler/Crawler.vcxproj.filters
index a450426a..c570c940 100644
--- a/Crawler/Crawler.vcxproj.filters
+++ b/Crawler/Crawler.vcxproj.filters
@@ -105,9 +105,6 @@
Header Files
-
- Header Files
-
Header Files
@@ -231,6 +228,9 @@
Header Files
+
+ Header Files
+
@@ -386,12 +386,12 @@
Source Files
-
- Source Files\Interface
-
Source Files\Interface
+
+ Source Files
+
diff --git a/Crawler/OverworldDisplayWindow.cpp b/Crawler/OverworldDisplayWindow.cpp
deleted file mode 100644
index e69de29b..00000000
diff --git a/Crawler/State_OverworldMap.cpp b/Crawler/State_OverworldMap.cpp
index 863a691d..deefadea 100644
--- a/Crawler/State_OverworldMap.cpp
+++ b/Crawler/State_OverworldMap.cpp
@@ -74,7 +74,7 @@ void State_OverworldMap::Draw(Crawler*game){
}
}
for(ConnectionPoint&cp:connections){
- if(Unlock::IsUnlocked(cp)&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){
+ if(Unlock::IsUnlocked(cp)&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)&&(&cp==currentConnectionPoint||cp.IsNeighbor(*currentConnectionPoint))){
float borderThickness=4;
vf2d crosshairExtension={std::min(0.25f*cp.rect.size.x-borderThickness/2,12.f),std::min(0.25f*cp.rect.size.y-borderThickness/2,12.f)};
vf2d pulsatingAmt=vf2d{1,1}*std::abs(std::sin(currentTime*3))*2;
@@ -82,28 +82,28 @@ void State_OverworldMap::Draw(Crawler*game){
vf2d pos=cp.rect.pos+vf2d{0,cp.rect.size.y-borderThickness}+vf2d{-pulsatingAmt.x,pulsatingAmt.y};
vf2d size={borderThickness+crosshairExtension.x,borderThickness};
game->view.FillRectDecal(pos,size,RED);
- pos=vf2d{pos.x,pos.y-crosshairExtension.y}+vf2d{-pulsatingAmt.x,pulsatingAmt.y};
+ pos=vf2d{pos.x,pos.y-crosshairExtension.y};
size={borderThickness,crosshairExtension.y};
game->view.FillRectDecal(pos,size,RED);
//Lower-Right Corner
pos=cp.rect.pos+vf2d{cp.rect.size.x-borderThickness-crosshairExtension.x,cp.rect.size.y-borderThickness}+vf2d{pulsatingAmt.x,pulsatingAmt.y};
size={borderThickness+crosshairExtension.x,borderThickness};
game->view.FillRectDecal(pos,size,RED);
- pos=vf2d{pos.x+crosshairExtension.x,pos.y-crosshairExtension.y}+vf2d{pulsatingAmt.x,pulsatingAmt.y};
+ pos=vf2d{pos.x+crosshairExtension.x,pos.y-crosshairExtension.y};
size={borderThickness,crosshairExtension.y};
game->view.FillRectDecal(pos,size,RED);
//Upper-Left Corner
pos=cp.rect.pos+vf2d{0,0}+vf2d{-pulsatingAmt.x,-pulsatingAmt.y};
size={borderThickness+crosshairExtension.x,borderThickness};
game->view.FillRectDecal(pos,size,RED);
- pos=vf2d{pos.x,pos.y+borderThickness}+vf2d{-pulsatingAmt.x,-pulsatingAmt.y};
+ pos=vf2d{pos.x,pos.y+borderThickness};
size={borderThickness,crosshairExtension.y};
game->view.FillRectDecal(pos,size,RED);
//Upper-Right Corner
pos=cp.rect.pos+vf2d{cp.rect.size.x-borderThickness-crosshairExtension.x,0}+vf2d{pulsatingAmt.x,-pulsatingAmt.y};
size={borderThickness+crosshairExtension.x,borderThickness};
game->view.FillRectDecal(pos,size,RED);
- pos=vf2d{pos.x+crosshairExtension.x,pos.y+borderThickness}+vf2d{pulsatingAmt.x,-pulsatingAmt.y};
+ pos=vf2d{pos.x+crosshairExtension.x,pos.y+borderThickness};
size={borderThickness,crosshairExtension.y};
game->view.FillRectDecal(pos,size,RED);
break;
diff --git a/Crawler/State_OverworldMap.h b/Crawler/State_OverworldMap.h
index e0a6899e..3f1a10ba 100644
--- a/Crawler/State_OverworldMap.h
+++ b/Crawler/State_OverworldMap.h
@@ -5,7 +5,7 @@
class State_OverworldMap:public GameState{
friend class Crawler;
ConnectionPoint*currentConnectionPoint;
- float currentTime;
+ float currentTime=0;
vf2d playerTargetPos;
const float playerMoveSpd=48.0;
public:
@@ -13,7 +13,7 @@ public:
static std::vectorconnections;
static ConnectionPoint&GetCurrentConnectionPoint();
void SetStageMarker(std::string connectionName);
- ConnectionPoint&ConnectionPointFromIndex(int ind);
+ static ConnectionPoint&ConnectionPointFromIndex(int ind);
virtual void OnStateChange(GameState*prevState)override;
virtual void OnUserUpdate(Crawler*game)override;
virtual void Draw(Crawler*game)override;
diff --git a/Crawler/Version.h b/Crawler/Version.h
index a70c2410..4ff40336 100644
--- a/Crawler/Version.h
+++ b/Crawler/Version.h
@@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
-#define VERSION_BUILD 2718
+#define VERSION_BUILD 2736
#define stringify(a) stringify_(a)
#define stringify_(a) #a