summaryrefslogtreecommitdiff
path: root/src/shyguy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shyguy.cpp')
-rw-r--r--src/shyguy.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index ef807f0..34de1d9 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -65,6 +65,7 @@ class daShyGuy : public dEn_c {
u32 cmgr_returnValue;
bool isBouncing;
float balloonSize;
+ char backFire;
char spikeTurn;
dStageActor_c *spikeA;
dStageActor_c *spikeB;
@@ -292,7 +293,19 @@ daShyGuy *daShyGuy::build() {
dStateBase_c *stateVar;
if (this->type < 6) { // Regular Shy Guys Except Jumper
- stateVar = &StateID_FireKnockBack;
+ char FirePos;
+
+ if (this->pos.x < apOther->owner->pos.x) { FirePos = 0; } // Fire is to the right
+ else { FirePos = 1; } // Fire is to the left
+
+
+ if (this->direction != FirePos) { // Fire is from behind
+ this->backFire = 1;
+ stateVar = &StateID_FireKnockBack;
+ }
+ else {
+ stateVar = &StateID_FireKnockBack;
+ }
}
else if (this->type > 8) { // Giants
return;
@@ -1328,7 +1341,10 @@ void daShyGuy::updateModelMatrices() {
///////////////
void daShyGuy::beginState_FireKnockBack() {
bindAnimChr_and_setUpdateRate("c18_C_BLOCK_BREAK_R", 1, 0.0, 1.0);
- this->direction ^= 1;
+
+ if (this->backFire == 0) { this->direction ^= 1; }
+ else { this->backFire = 0; }
+
this->speed.x = (this->direction) ? -this->XSpeed / 6.0f : this->XSpeed / 6.0f;
}
void daShyGuy::executeState_FireKnockBack() {