Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2507516a85 | |||
| 0398006fdc | |||
| ae13a2db6b | |||
| 984b8ad3e9 | |||
| b1148c0c6c | |||
| a5c1e34b8d | |||
| e55a399bad | |||
| 06b7052bf2 | |||
| 2dfcd3ad95 | |||
| 44924ea1f9 | |||
| 7943fc7ad6 | |||
| be331cb778 | |||
| a72dc94d5d | |||
| c5f3bfc0cd | |||
| 98366ec038 | |||
| 398bc725b6 | |||
| 8859f652b9 | |||
| da81f21799 | |||
| f84d1ac4a1 | |||
| b81bb9eeea |
@@ -30,6 +30,7 @@ public:
|
||||
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID);
|
||||
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
|
||||
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
|
||||
bool SpecialAbilityKeyDown() const { return m_SpecialAbilityKeyDown; }
|
||||
|
||||
protected:
|
||||
const int m_PlayerID;
|
||||
@@ -145,10 +146,10 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
if (m_NumberOfMovementKeysDown == 0) {
|
||||
m_MovementKeyDown = false;
|
||||
}
|
||||
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
|
||||
m_AssaultDashTapDirection = m_CurrentDirectionVector;
|
||||
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
||||
|
||||
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
|
||||
m_AssaultDashTapDirection = m_CurrentDirectionVector;
|
||||
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,18 +162,11 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
}
|
||||
|
||||
if (e.Command == "SpecialAbility") {
|
||||
if (e.Value > 0) {
|
||||
m_SpecialAbilityKeyDown = true;
|
||||
} else {
|
||||
m_SpecialAbilityKeyDown = false;
|
||||
}
|
||||
}
|
||||
if (m_SpecialAbilityKeyDown && m_MovementKeyDown) {
|
||||
m_ShiftDashing = true;
|
||||
} else {
|
||||
m_ShiftDashing = false;
|
||||
m_SpecialAbilityKeyDown = e.Value > 0;
|
||||
}
|
||||
|
||||
m_ShiftDashing = m_SpecialAbilityKeyDown && m_MovementKeyDown;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#define MiniDump_h__
|
||||
|
||||
#include <Windows.h>
|
||||
#include <DbgHelp.h>
|
||||
|
||||
long WINAPI Create_Dump_Immediate(LPEXCEPTION_POINTERS pException);
|
||||
void WINAPI Create_Dump(PEXCEPTION_POINTERS pException, BOOL File_Flag, BOOL Show_Flag);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,8 @@ private:
|
||||
bool m_LeftFoot = false;
|
||||
// To get a difference when calculating the walking state.
|
||||
glm::vec3 m_LastPosition = glm::vec3();
|
||||
// Used to track afterimages for sprint effect.
|
||||
float m_SprintEffectTimer;
|
||||
// The logic for making the sound play when player is moving
|
||||
void playerStep(double dt);
|
||||
// Spawn a hexagon at origin of an Entity
|
||||
|
||||
@@ -27,4 +27,5 @@ M=SwitchToClient
|
||||
P=SwitchToPlayer
|
||||
K=TakeDamage,1500
|
||||
F2=PerformanceTimingResetAllTimers
|
||||
F3=PerformanceTimingCreateExcelData
|
||||
F3=PerformanceTimingCreateExcelData
|
||||
F4=SwapToClassPick
|
||||
@@ -59,4 +59,5 @@
|
||||
<xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/>
|
||||
<xs:include schemaLocation="Components/FloatingEffect.xsd"/>
|
||||
<xs:include schemaLocation="Components/BoostIconsHUD.xsd"/>
|
||||
<xs:include schemaLocation="Components/InputCmdButton.xsd"/>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<InputCmdButton xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="InputCmdButton.xsd">
|
||||
<Command></Command>
|
||||
<PressValue>0.0</PressValue>
|
||||
</InputCmdButton>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||
|
||||
<xs:element name="InputCmdButton">
|
||||
<xs:annotation><xs:documentation>Used with a Button component, the button will send an inputCommand event instead of ButtonPressed/Released event.</xs:documentation></xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="Command" type="t:string" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>The command name for the inputCommand.</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="PressValue" type="t:float" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>The value in inputCommand.Value that will be sent on button press.</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<SprintAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SprintAbility.xsd">
|
||||
<CoolDownMaxTimer>2.0</CoolDownMaxTimer>
|
||||
<StrengthOfEffect>1.3</StrengthOfEffect>
|
||||
<Active>false</Active>
|
||||
</SprintAbility>
|
||||
@@ -9,8 +9,11 @@
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="CoolDownMaxTimer" type="t:double" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>This is the cooldown on sprint</xs:documentation></xs:annotation>
|
||||
<xs:element name="StrengthOfEffect" type="t:double" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>This is the strength of the sprint effect</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="Active" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>True if currently sprinting.</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,308 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="OverwatchCamera" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:RaptorCopter>
|
||||
<Speed>0.049999997019767761</Speed>
|
||||
<Axis X="0" Y="1" Z="0"/>
|
||||
</c:RaptorCopter>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="-4" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="CameraAnchor">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="66" Y="59.2180023" Z="0"/>
|
||||
<Orientation X="5.89000034" Y="1.57079637" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="SpectatorCamera">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="SpectatorHUD">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="-0.5"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="CapturePointHUD">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.190541431" Z="0"/>
|
||||
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.919596612" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0.811270177" Y="0.440691769" Z="-0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="1.62788737" Y="0.919596612" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="-0.820431828" Y="0.441878349" Z="-0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Percentage>0.10332605343919568</Percentage>
|
||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Orientation X="0" Y="0" Z="4.71238899"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD/>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="RespawnTimer">
|
||||
<Components>
|
||||
<c:Text>
|
||||
<Content>16</Content>
|
||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||
</c:Text>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.178199276" Z="0"/>
|
||||
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="PickClassCamera">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="PickClassHUD">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="-0.5"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="DefenderClassPick">
|
||||
<Components>
|
||||
<c:Button/>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:InputCmdButton>
|
||||
<Command>PickClass</Command>
|
||||
<PressValue>2</PressValue>
|
||||
</c:InputCmdButton>
|
||||
<c:Transform>
|
||||
<Position X="0.349999994" Y="0.0500000007" Z="0"/>
|
||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="AssaultClassPick">
|
||||
<Components>
|
||||
<c:Button/>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitRaptor.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:InputCmdButton>
|
||||
<Command>PickClass</Command>
|
||||
<PressValue>1</PressValue>
|
||||
</c:InputCmdButton>
|
||||
<c:Transform>
|
||||
<Position X="0.349999994" Y="0.149504215" Z="0"/>
|
||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SniperClassPick">
|
||||
<Components>
|
||||
<c:Button/>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Test/aM4ME4GR.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:InputCmdButton>
|
||||
<Command>PickClass</Command>
|
||||
<PressValue>3</PressValue>
|
||||
</c:InputCmdButton>
|
||||
<c:Transform>
|
||||
<Position X="0.349999994" Y="-0.0500000007" Z="0"/>
|
||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -1,219 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="SpectatorCamera" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="SpectatorHUD">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="-0.5"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="RespawnTimer">
|
||||
<Components>
|
||||
<c:Text>
|
||||
<Content>Time to respawn: 0</Content>
|
||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||
<Alignment>
|
||||
<Left/>
|
||||
</Alignment>
|
||||
</c:Text>
|
||||
<c:Transform>
|
||||
<Position X="-0.115000000" Y="0.15304254" Z="0"/>
|
||||
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="CapturePointHUD">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.190541431" Z="0"/>
|
||||
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.919596612" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0.811270177" Y="0.440691769" Z="-0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="1.62788737" Y="0.919596612" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="-0.820431828" Y="0.441878349" Z="-0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD>
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Percentage>0.59265931447347009</Percentage>
|
||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
<Orientation X="0" Y="0" Z="4.71238899"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BackgroundHexagon">
|
||||
<Components>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ProgressionHexagon">
|
||||
<Components>
|
||||
<c:CapturePointHUD/>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="SprintEffect" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName1></AnimationName1>
|
||||
<AnimationName2></AnimationName2>
|
||||
<AnimationName3></AnimationName3>
|
||||
</c:Animation>
|
||||
<c:Lifetime>
|
||||
<Lifetime>0.15</Lifetime>
|
||||
</c:Lifetime>
|
||||
<c:ExplosionEffect>
|
||||
<Velocity X="0" Y="0" Z="0"/>
|
||||
<ExplosionDuration>0.15</ExplosionDuration>
|
||||
</c:ExplosionEffect>
|
||||
<c:Model>
|
||||
<Resource></Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children/>
|
||||
|
||||
</Entity>
|
||||
@@ -62,6 +62,7 @@
|
||||
<xs:element ref="c:DoubleJump" minOccurs="0"/>
|
||||
<xs:element ref="c:HealthHUD" minOccurs="0"/>
|
||||
<xs:element ref="c:SpriteIndicator" minOccurs="0"/>
|
||||
<xs:element ref="c:InputCmdButton" minOccurs="0"/>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "GUI/ButtonSystem.h"
|
||||
#include "Input/EInputCommand.h"
|
||||
|
||||
ButtonSystem::ButtonSystem(SystemParams params, IRenderer* renderer)
|
||||
: System(params)
|
||||
@@ -37,10 +38,20 @@ bool ButtonSystem::OnMousePress(const Events::MousePress& e)
|
||||
m_PickEntity = EntityWrapper(m_World, m_PickData.Entity);
|
||||
|
||||
//You have clicked on a button entity, send pressed event.
|
||||
Events::ButtonPressed ePressed;
|
||||
ePressed.Entity = m_PickEntity;
|
||||
ePressed.EntityName = m_PickEntity.Name();
|
||||
m_EventBroker->Publish(ePressed);
|
||||
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
||||
Events::InputCommand eInputCmd;
|
||||
eInputCmd.PlayerID = LocalPlayer.ID;
|
||||
eInputCmd.Player = LocalPlayer;
|
||||
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
||||
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
||||
eInputCmd.Value = (float)button["InputCmdButton"]["PressValue"];
|
||||
m_EventBroker->Publish(eInputCmd);
|
||||
} else {
|
||||
Events::ButtonPressed ePressed;
|
||||
ePressed.Entity = m_PickEntity;
|
||||
ePressed.EntityName = m_PickEntity.Name();
|
||||
m_EventBroker->Publish(ePressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,10 +66,20 @@ bool ButtonSystem::OnMouseRelease(const Events::MouseRelease& e)
|
||||
if(m_PickData.Entity != EntityID_Invalid && m_PickData.World == m_World) {
|
||||
EntityWrapper ent = EntityWrapper(m_World, m_PickData.Entity);
|
||||
|
||||
Events::ButtonReleased eReleased;
|
||||
eReleased.EntityName = m_PickEntity.Name();
|
||||
eReleased.Entity = m_PickEntity;
|
||||
m_EventBroker->Publish(eReleased);
|
||||
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
||||
Events::InputCommand eInputCmd;
|
||||
eInputCmd.PlayerID = LocalPlayer.ID;
|
||||
eInputCmd.Player = LocalPlayer;
|
||||
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
||||
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
||||
eInputCmd.Value = 0;
|
||||
m_EventBroker->Publish(eInputCmd);
|
||||
} else {
|
||||
Events::ButtonReleased eReleased;
|
||||
eReleased.EntityName = m_PickEntity.Name();
|
||||
eReleased.Entity = m_PickEntity;
|
||||
m_EventBroker->Publish(eReleased);
|
||||
}
|
||||
|
||||
if(m_World->HasComponent(m_PickData.Entity, "Button")) {
|
||||
if (ent == m_PickEntity) {
|
||||
|
||||
@@ -47,7 +47,7 @@ int UDPClient::readBuffer()
|
||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||
if (sizeOfPacket > m_Socket->available()) {
|
||||
LOG_WARNING("UDPClient::readBuffer(): We haven't got the whole packet yet.");
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
// if the buffer is to small increase the size of it
|
||||
if (sizeOfPacket > m_BufferSize) {
|
||||
|
||||
@@ -94,7 +94,7 @@ int UDPServer::readBuffer()
|
||||
|
||||
if (sizeOfPacket > m_Socket->available()) {
|
||||
LOG_WARNING("UDPServer::readBuffer(): We haven't got the whole packet yet.");
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
// if the buffer is to small increase the size of it
|
||||
|
||||
+80
-71
@@ -1,101 +1,110 @@
|
||||
/*
|
||||
Inspired by Original Author: Vladimir Sedach.
|
||||
Author: Vladimir Sedach.
|
||||
|
||||
Purpose: demo of Call Stack creation by our own means,
|
||||
and with MiniDumpWriteDump() function of DbgHelp.dll.
|
||||
Purpose: demo of Call Stack creation by our own means,
|
||||
and with MiniDumpWriteDump() function of DbgHelp.dll.
|
||||
*/
|
||||
|
||||
#include "MiniDump.h"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <ctime>
|
||||
#include <comdef.h>
|
||||
|
||||
#pragma optimize("y", off) //generate stack frame pointers for all functions - same as /Oy- in the project
|
||||
#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union
|
||||
#pragma warning(disable: 4100) //unreferenced formal parameter
|
||||
#include <windows.h>
|
||||
#include <tlhelp32.h>
|
||||
//#include "dbghelp.h"
|
||||
|
||||
typedef BOOL(WINAPI * MINIDUMP_WRITE_DUMP)(
|
||||
IN HANDLE hProcess,
|
||||
IN DWORD ProcessId,
|
||||
IN HANDLE hFile,
|
||||
IN MINIDUMP_TYPE DumpType,
|
||||
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
|
||||
IN PVOID UserStreamParam, OPTIONAL
|
||||
IN PVOID CallbackParam OPTIONAL
|
||||
);
|
||||
//#define DEBUG_DPRINTF 1 //allow d()
|
||||
//#include "wfun.h"
|
||||
|
||||
#pragma optimize("y", off) //generate stack frame pointers for all functions - same as /Oy- in the project
|
||||
#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union
|
||||
#pragma warning(disable: 4100) //unreferenced formal parameter
|
||||
|
||||
// In case you don't have dbghelp.h.
|
||||
#ifndef _DBGHELP_
|
||||
|
||||
typedef struct _MINIDUMP_EXCEPTION_INFORMATION {
|
||||
DWORD ThreadId;
|
||||
PEXCEPTION_POINTERS ExceptionPointers;
|
||||
BOOL ClientPointers;
|
||||
} MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
|
||||
|
||||
typedef enum _MINIDUMP_TYPE {
|
||||
MiniDumpNormal = 0x00000000,
|
||||
MiniDumpWithDataSegs = 0x00000001,
|
||||
} MINIDUMP_TYPE;
|
||||
|
||||
typedef BOOL (WINAPI * MINIDUMP_WRITE_DUMP)(
|
||||
IN HANDLE hProcess,
|
||||
IN DWORD ProcessId,
|
||||
IN HANDLE hFile,
|
||||
IN MINIDUMP_TYPE DumpType,
|
||||
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
|
||||
IN PVOID UserStreamParam, OPTIONAL
|
||||
IN PVOID CallbackParam OPTIONAL
|
||||
);
|
||||
|
||||
#else
|
||||
|
||||
typedef BOOL (WINAPI * MINIDUMP_WRITE_DUMP)(
|
||||
IN HANDLE hProcess,
|
||||
IN DWORD ProcessId,
|
||||
IN HANDLE hFile,
|
||||
IN MINIDUMP_TYPE DumpType,
|
||||
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
|
||||
IN PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
|
||||
IN PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
|
||||
);
|
||||
#endif //#ifndef _DBGHELP_
|
||||
|
||||
HMODULE hDbgHelp;
|
||||
MINIDUMP_WRITE_DUMP MiniDumpWriteDump_;
|
||||
|
||||
// Tool Help functions.
|
||||
typedef HANDLE (WINAPI * CREATE_TOOL_HELP32_SNAPSHOT)(DWORD dwFlags, DWORD th32ProcessID);
|
||||
|
||||
//*************************************************************************************
|
||||
long WINAPI Create_Dump_Immediate(LPEXCEPTION_POINTERS pException)
|
||||
void WINAPI Create_Dump(PEXCEPTION_POINTERS pException, BOOL File_Flag, BOOL Show_Flag)
|
||||
//*************************************************************************************
|
||||
// Create dump.
|
||||
// pException can be either GetExceptionInformation() or NULL.
|
||||
// If File_Flag = TRUE - write dump files (.dmz and .dmp) with the name of the current process.
|
||||
// If Show_Flag = TRUE - show message with Get_Exception_Info() dump.
|
||||
{
|
||||
// Try to get MiniDumpWriteDump() address.
|
||||
HMODULE hDbgHelp = LoadLibrary("DBGHELP.DLL");
|
||||
MINIDUMP_WRITE_DUMP MiniDumpWriteDump_ = (MINIDUMP_WRITE_DUMP)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
|
||||
hDbgHelp = LoadLibrary("DBGHELP.DLL");
|
||||
MiniDumpWriteDump_ = (MINIDUMP_WRITE_DUMP)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
|
||||
|
||||
// If MiniDumpWriteDump() of DbgHelp.dll available.
|
||||
if (MiniDumpWriteDump_) {
|
||||
// Get absolute path of current process: C:/ ... /name.exe
|
||||
CHAR Dump_Path[MAX_PATH];
|
||||
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path));
|
||||
std::string path(Dump_Path);
|
||||
// If MiniDumpWriteDump() of DbgHelp.dll available.
|
||||
if (MiniDumpWriteDump_)
|
||||
{
|
||||
HANDLE hDump_File;
|
||||
CHAR Dump_Path[MAX_PATH];
|
||||
|
||||
// Get current time in a string.
|
||||
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path)); //path of current process
|
||||
std::time_t t = std::time(NULL);
|
||||
char tStr[16];
|
||||
std::strftime(tStr, ARRAYSIZE(tStr), " %a %H-%M-%S", std::localtime(&t));
|
||||
std::strftime(tStr, 32, " %a %H-%M-%S", std::localtime(&t));
|
||||
std::string time(tStr);
|
||||
// Remove the .exe from path
|
||||
std::string path(Dump_Path);
|
||||
path = path.substr(0, path.length() - 4);
|
||||
// Add the current time and .dmp
|
||||
path += "dump" + time + ".dmp";
|
||||
path += time + ".dmp";
|
||||
|
||||
DWORD procId = GetCurrentProcessId();
|
||||
DWORD threadId = GetCurrentThreadId();
|
||||
MINIDUMP_EXCEPTION_INFORMATION M;
|
||||
M.ThreadId = GetCurrentThreadId();
|
||||
M.ExceptionPointers = pException;
|
||||
M.ClientPointers = 0;
|
||||
|
||||
MINIDUMP_EXCEPTION_INFORMATION M;
|
||||
M.ThreadId = threadId;
|
||||
M.ExceptionPointers = pException;
|
||||
M.ClientPointers = TRUE;
|
||||
hDump_File = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
HANDLE hDump_File = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
HANDLE process = GetCurrentProcess();
|
||||
MiniDumpWriteDump_(GetCurrentProcess(), GetCurrentProcessId(), hDump_File,
|
||||
MiniDumpNormal, (pException) ? &M : NULL, NULL, NULL);
|
||||
|
||||
BOOL result = MiniDumpWriteDump_(process, procId, hDump_File
|
||||
, (MINIDUMP_TYPE)(MiniDumpWithDataSegs |
|
||||
MiniDumpWithHandleData |
|
||||
MiniDumpScanMemory |
|
||||
MiniDumpWithUnloadedModules |
|
||||
MiniDumpWithIndirectlyReferencedMemory |
|
||||
MiniDumpWithPrivateReadWriteMemory |
|
||||
MiniDumpWithFullMemoryInfo |
|
||||
MiniDumpWithThreadInfo |
|
||||
MiniDumpIgnoreInaccessibleMemory)
|
||||
, &M, NULL, NULL);
|
||||
HRESULT error = (HRESULT)GetLastError();
|
||||
CloseHandle(hDump_File);
|
||||
|
||||
CloseHandle(hDump_File);
|
||||
if (!result) {
|
||||
_com_error cErr(error);
|
||||
HRESULT actualErrorCode = error & 0xFFFF;
|
||||
char hexErrBuf[16];
|
||||
std::sprintf(hexErrBuf, "0x%x", actualErrorCode);
|
||||
std::cout << "Bad memory dump at: \"" << path.c_str() << "\"" << std::endl
|
||||
<< "because MiniDumpWriteDump failed with error #" << actualErrorCode << " (" << hexErrBuf << "): \"" << cErr.ErrorMessage() << "\"" << std::endl;
|
||||
MessageBox(NULL, "Application crashed, memory dump failed, but file was created.", "MiniDump", MB_ICONHAND | MB_OK);
|
||||
} else {
|
||||
std::cout << "Memory dumped to: \"" << path.c_str() << "\"" << std::endl;
|
||||
MessageBox(NULL, ("Application crashed, memory dumped to: " + path).c_str(), "MiniDump", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
std::cout << "Memory dumped to: \"" << path.c_str() << "\"";
|
||||
MessageBox(NULL, ("Application crashed, memory dumped to: " + path).c_str(), "MiniDump", MB_ICONHAND | MB_OK);
|
||||
} else {
|
||||
std::cout << "Memory dump failed because MiniDumpWriteDump is not available." << std::endl;
|
||||
MessageBox(NULL, "Application crashed, could not create a memory dump.", "MiniDump", MB_ICONHAND | MB_OK);
|
||||
MessageBox(NULL, "Application crashed, memory dump failed.", "MiniDump", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
|
||||
// Basically, terminate the application.
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
PlayerMovementSystem::PlayerMovementSystem(SystemParams params)
|
||||
: System(params)
|
||||
, m_SprintEffectTimer(0.f)
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &PlayerMovementSystem::OnPlayerSpawned);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &PlayerMovementSystem::OnDoubleJump);
|
||||
@@ -19,8 +20,48 @@ void PlayerMovementSystem::Update(double dt)
|
||||
{
|
||||
updateMovementControllers(dt);
|
||||
// Only do physics calculations on client and only for themselves.
|
||||
if (IsClient && LocalPlayer.Valid()) {
|
||||
updateVelocity(LocalPlayer, dt);
|
||||
if (IsClient) {
|
||||
if (LocalPlayer.Valid()){
|
||||
updateVelocity(LocalPlayer, dt);
|
||||
}
|
||||
m_SprintEffectTimer += dt;
|
||||
if (m_SprintEffectTimer < 0.016f) {
|
||||
return;
|
||||
}
|
||||
m_SprintEffectTimer = 0.f;
|
||||
const ComponentPool* pool = m_World->GetComponents("SprintAbility");
|
||||
if (pool == nullptr) {
|
||||
return;
|
||||
}
|
||||
for (auto cSprint : *pool) {
|
||||
if (cSprint.EntityID != LocalPlayer.ID && (bool)cSprint["Active"]) {
|
||||
// Spawn one afterimage for each player that sprints.
|
||||
EntityWrapper player(m_World, cSprint.EntityID);
|
||||
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/SprintEffect.xml");
|
||||
EntityWrapper sprintEffect = entityFile->MergeInto(m_World);
|
||||
auto playerModel = player.FirstChildByName("PlayerModel");
|
||||
if (!playerModel.Valid()) {
|
||||
continue;
|
||||
}
|
||||
if (!playerModel.HasComponent("Model")) {
|
||||
continue;
|
||||
}
|
||||
if (!playerModel.HasComponent("Animation")) {
|
||||
continue;
|
||||
}
|
||||
auto playerEntityModel = playerModel["Model"];
|
||||
auto playerEntityAnimation = playerModel["Animation"];
|
||||
playerEntityModel.Copy(sprintEffect["Model"]);
|
||||
playerEntityAnimation.Copy(sprintEffect["Animation"]);
|
||||
sprintEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"];
|
||||
((glm::vec4&)sprintEffect["ExplosionEffect"]["EndColor"]).w = 0.f;
|
||||
sprintEffect["Animation"]["Speed1"] = 0.0;
|
||||
sprintEffect["Animation"]["Speed2"] = 0.0;
|
||||
sprintEffect["Animation"]["Speed3"] = 0.0;
|
||||
sprintEffect["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
|
||||
sprintEffect["Transform"]["Orientation"] = (glm::vec3)player["Transform"]["Orientation"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +103,15 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
playerMovementSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||
playerCrouchSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||
}
|
||||
|
||||
bool sniperSprinting = false;
|
||||
if (player.HasComponent("SprintAbility")) {
|
||||
(bool)player["SprintAbility"]["Active"] = controller->SpecialAbilityKeyDown();
|
||||
if (controller->SpecialAbilityKeyDown()) {
|
||||
playerMovementSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||
playerCrouchSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||
sniperSprinting = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.HasComponent("Physics")) {
|
||||
ComponentWrapper cPhysics = player["Physics"];
|
||||
@@ -118,6 +167,9 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
if (playerBoostAssaultEntity.Valid()) {
|
||||
accelerationSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||
}
|
||||
if (sniperSprinting) {
|
||||
accelerationSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||
}
|
||||
velocity += accelerationSpeed * wishDirection;
|
||||
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void PlayerSpawnSystem::Update(double dt)
|
||||
|
||||
bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
||||
{
|
||||
if (e.Command != "PickTeam") {
|
||||
if (e.Command != "PickTeam" && e.Command != "SwapToClassPick") {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -113,11 +113,12 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
||||
return false;
|
||||
}
|
||||
|
||||
// A dead client should be able to swap to the spectator camera.
|
||||
// A dead client should be able to swap to the overwatch camera.
|
||||
if (IsClient && !LocalPlayer.Valid()) {
|
||||
// Set the spectator camera as active, if it exists.
|
||||
// Find the camera.
|
||||
EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera");
|
||||
// Set the camera as active, if it exists.
|
||||
// Find the respawn camera or class pick camera.
|
||||
std::string camName = e.Command == "SwapToClassPick" ? "PickClassCamera" : "SpectatorCamera";
|
||||
EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName);
|
||||
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
|
||||
Events::SetCamera eSetCamera;
|
||||
eSetCamera.CameraEntity = spectatorCam;
|
||||
@@ -135,10 +136,18 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
||||
auto iter = m_SpawnRequests.begin();
|
||||
for (; iter != m_SpawnRequests.end(); ++iter) {
|
||||
if (iter->PlayerID == e.PlayerID) {
|
||||
// If player wants to switch class, remove their spawn request.
|
||||
if (e.Command == "SwapToClassPick") {
|
||||
m_SpawnRequests.erase(iter);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.Command == "SwapToClassPick") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (iter != m_SpawnRequests.end()) {
|
||||
// If player is in queue to spawn, then change their team affiliation in the request.
|
||||
iter->Team = (ComponentInfo::EnumType)e.Value;
|
||||
|
||||
+15
-4
@@ -1,16 +1,27 @@
|
||||
#include "Game.h"
|
||||
#include "MiniDump.h"
|
||||
|
||||
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
SetUnhandledExceptionFilter(Create_Dump_Immediate);
|
||||
::SetUnhandledExceptionFilter(CrashHandler);
|
||||
|
||||
Game game(argc, argv);
|
||||
while (game.Running()) {
|
||||
PerformanceTimer::StartTimer("Game-Tick");
|
||||
PerformanceTimer::StartTimer("Game-Tick");
|
||||
game.Tick();
|
||||
PerformanceTimer::StopTimer("Game-Tick");
|
||||
PerformanceTimer::StopTimer("Game-Tick");
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException)
|
||||
{
|
||||
//Take minidump. path should be bin/TacticalZ.dmp
|
||||
//Then show MessageBox, and exit application.
|
||||
Create_Dump(pException, 1, 1);
|
||||
|
||||
return EXCEPTION_EXECUTE_HANDLER;// EXCEPTION_CONTINUE_SEARCH
|
||||
}
|
||||
Reference in New Issue
Block a user