|
|
|
@ -1,11 +1,7 @@ |
|
|
|
|
#define OLC_PGE_APPLICATION |
|
|
|
|
#include "olcPixelGameEngine.h" |
|
|
|
|
#define OLC_SOUNDWAVE |
|
|
|
|
#include "olcSoundWaveEngine.h" |
|
|
|
|
#define OLC_PGEX_TRANSFORMEDVIEW |
|
|
|
|
#include "olcPGEX_TransformedView.h" |
|
|
|
|
#include "olcUTIL_Geometry2D.h" |
|
|
|
|
#include "olcUTIL_Camera2D.h" |
|
|
|
|
|
|
|
|
|
#include "VirusAttack.h" |
|
|
|
|
|
|
|
|
@ -121,7 +117,29 @@ bool VirusAttack::OnUserUpdate(float fElapsedTime){ |
|
|
|
|
HandleDraggingSelection(); |
|
|
|
|
HandleRightClickMove(); |
|
|
|
|
|
|
|
|
|
game.HandlePanAndZoom(); |
|
|
|
|
if(GetKey(A).bHeld){ |
|
|
|
|
game.MoveWorldOffset({-256*fElapsedTime,0}); |
|
|
|
|
} |
|
|
|
|
if(GetKey(W).bHeld){ |
|
|
|
|
game.MoveWorldOffset({0,-256*fElapsedTime}); |
|
|
|
|
} |
|
|
|
|
if(GetKey(S).bHeld){ |
|
|
|
|
game.MoveWorldOffset({0,256*fElapsedTime}); |
|
|
|
|
} |
|
|
|
|
if(GetKey(D).bHeld){ |
|
|
|
|
game.MoveWorldOffset({256*fElapsedTime,0}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(GetMouseWheel()>0){ |
|
|
|
|
if(game.GetWorldScale().x<2){ |
|
|
|
|
game.ZoomAtScreenPos(1.25,GetMousePos()); |
|
|
|
|
} |
|
|
|
|
} else |
|
|
|
|
if(GetMouseWheel()<0){ |
|
|
|
|
if(game.GetWorldScale().x>0.5){ |
|
|
|
|
game.ZoomAtScreenPos(0.75,GetMousePos()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for(auto&u:units){ |
|
|
|
|
Unit*closestUnit=nullptr; |
|
|
|
|