Pulsate system implemented.
This commit is contained in:
@@ -14,4 +14,6 @@
|
|||||||
<!--<ReverseAnimation>0</ReverseAnimation>-->
|
<!--<ReverseAnimation>0</ReverseAnimation>-->
|
||||||
<!--<Wireframe>0</Wireframe>-->
|
<!--<Wireframe>0</Wireframe>-->
|
||||||
<ExponentialAccelaration>0</ExponentialAccelaration>
|
<ExponentialAccelaration>0</ExponentialAccelaration>
|
||||||
|
<Pulsate>0</Pulsate>
|
||||||
|
<Reverse>0</Reverse>
|
||||||
</ExplosionEffect>
|
</ExplosionEffect>
|
||||||
@@ -51,6 +51,12 @@
|
|||||||
<xs:element name="ExponentialAccelaration" type="t:bool" minOccurs="0">
|
<xs:element name="ExponentialAccelaration" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Linear/Exponential accelaration</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Linear/Exponential accelaration</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<xs:element name="Pulsate" type="t:bool" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Pulsate the effect</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Reverse" type="t:bool" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Reverse the effect</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -4,15 +4,18 @@ void ExplosionEffectSystem::UpdateComponent(EntityWrapper& entity, ComponentWrap
|
|||||||
{
|
{
|
||||||
if ((double)component["TimeSinceDeath"] > (double)component["ExplosionDuration"]) {
|
if ((double)component["TimeSinceDeath"] > (double)component["ExplosionDuration"]) {
|
||||||
(double)component["TimeSinceDeath"] = 0.f;
|
(double)component["TimeSinceDeath"] = 0.f;
|
||||||
|
if ((bool)component["Pulsate"] == true) {
|
||||||
|
(bool)component["Reverse"] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//((glm::vec2)component["Velocity"]).x = min(((glm::vec2)component["Velocity"]).x, ((glm::vec2)component["Velocity"]).y);
|
//((glm::vec2)component["Velocity"]).x = min(((glm::vec2)component["Velocity"]).x, ((glm::vec2)component["Velocity"]).y);
|
||||||
|
|
||||||
(double&)component["TimeSinceDeath"] += dt;
|
(double&)component["TimeSinceDeath"] += dt;
|
||||||
|
|
||||||
//if ((bool)component["Pulsate"] == true) {
|
if ((bool)component["Pulsate"] == true) {
|
||||||
// if ((double)component["TimeSinceDeath"] > (double)component["ExplosionDuration"] * 0.5) {
|
if ((double)component["TimeSinceDeath"] > (double)component["ExplosionDuration"] * 0.5) {
|
||||||
// (bool)component["Reverse"] = true;
|
(bool)component["Reverse"] = true;
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user