diff options
Diffstat (limited to 'src/bossMegaGoomba.cpp')
-rw-r--r-- | src/bossMegaGoomba.cpp | 175 |
1 files changed, 87 insertions, 88 deletions
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index d06df68..3dde8a6 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -120,8 +120,8 @@ class daMegaGoomba_c : public dEn_c { DECLARE_STATE(Shrink); DECLARE_STATE(Walk); DECLARE_STATE(Turn); - DECLARE_STATE(Jump); - DECLARE_STATE(Launch); + // DECLARE_STATE(Jump); + // DECLARE_STATE(Launch); // DECLARE_STATE(Kameck); // DECLARE_STATE(Outro); @@ -147,8 +147,8 @@ extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); CREATE_STATE(daMegaGoomba_c, Shrink); CREATE_STATE(daMegaGoomba_c, Walk); CREATE_STATE(daMegaGoomba_c, Turn); -CREATE_STATE(daMegaGoomba_c, Jump); -CREATE_STATE(daMegaGoomba_c, Launch); +// CREATE_STATE(daMegaGoomba_c, Jump); +// CREATE_STATE(daMegaGoomba_c, Launch); // CREATE_STATE(daMegaGoomba_c, Outro); @@ -284,7 +284,6 @@ void daMegaGoomba_c::bindAnimChr_and_setUpdateRate(const char* name, int unk, fl void daMegaGoomba_c::dieFall_Begin() { this->dEn_c::dieFall_Begin(); } -//TODO make this real perty like void daMegaGoomba_c::dieFall_Execute() { this->timer = this->timer + 1.0; @@ -400,9 +399,9 @@ int daMegaGoomba_c::onCreate() { // doStateChange(&StateID_Grow); - scale.x = 5.0; - scale.y = 5.0; - scale.z = 5.0; + scale.x = 4.0; + scale.y = 4.0; + scale.z = 4.0; setNewActivePhysicsRect(this, &this->scale); doStateChange(&StateID_Walk); @@ -550,93 +549,93 @@ void daMegaGoomba_c::endState_Shrink() { // Launch State - Launches some small goombas up in arcs -void daMegaGoomba_c::beginState_Launch() { - this->timer = 0.0; - rot.y = 0x0; -} -void daMegaGoomba_c::executeState_Launch() { - - if (this->timer < 120.0) { - // 3 shakes per second, exactly 24 shakes overall - this->rot.y = sin(this->timer * 3.14 / 5) * 4000; - - dStageActor_c *spawner = NULL; - // 120ticks / 120numbers * 3cases = 3avg kuribo - int randChoice = GenerateRandomNumber(120); - int randChoiceX = GenerateRandomNumber(10); - int randChoiceY = GenerateRandomNumber(7); - switch(randChoice) { - case 0: - case 1: - spawner = CreateActor(EN_KURIBO, 0, this->pos, 0, 0); - spawner->speed.x = randChoiceX - 5.0; - spawner->speed.y = randChoiceY + 6.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - break; - case 2: - spawner = CreateActor(EN_BEANS_KURIBO, 0, this->pos, 0, 0); - spawner->speed.x = randChoiceX - 5.0; - spawner->speed.y = randChoiceY + 6.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - break; - case 3: - spawner = CreateActor(EN_PATA_KURIBO, 0, this->pos, 0, 0); - spawner->speed.x = randChoiceX - 5.0; - spawner->speed.y = randChoiceY + 6.0; - spawner->scale = (Vec){1.0, 1.0, 1.0}; - break; - default: - break; - }; - } + // void daMegaGoomba_c::beginState_Launch() { + // this->timer = 0.0; + // rot.y = 0x0; + // } + // void daMegaGoomba_c::executeState_Launch() { + + // if (this->timer < 120.0) { + // // 3 shakes per second, exactly 24 shakes overall + // this->rot.y = sin(this->timer * 3.14 / 5) * 4000; + + // dStageActor_c *spawner = NULL; + // // 120ticks / 120numbers * 3cases = 3avg kuribo + // int randChoice = GenerateRandomNumber(120); + // int randChoiceX = GenerateRandomNumber(10); + // int randChoiceY = GenerateRandomNumber(7); + // switch(randChoice) { + // case 0: + // case 1: + // spawner = CreateActor(EN_KURIBO, 0, this->pos, 0, 0); + // spawner->speed.x = randChoiceX - 5.0; + // spawner->speed.y = randChoiceY + 6.0; + // spawner->scale = (Vec){1.0, 1.0, 1.0}; + // break; + // case 2: + // spawner = CreateActor(EN_BEANS_KURIBO, 0, this->pos, 0, 0); + // spawner->speed.x = randChoiceX - 5.0; + // spawner->speed.y = randChoiceY + 6.0; + // spawner->scale = (Vec){1.0, 1.0, 1.0}; + // break; + // case 3: + // spawner = CreateActor(EN_PATA_KURIBO, 0, this->pos, 0, 0); + // spawner->speed.x = randChoiceX - 5.0; + // spawner->speed.y = randChoiceY + 6.0; + // spawner->scale = (Vec){1.0, 1.0, 1.0}; + // break; + // default: + // break; + // }; + // } - if (this->timer > 150.0) { doStateChange(&StateID_Walk); } - this->timer = this->timer + 1.0; -} -void daMegaGoomba_c::endState_Launch() { - //rot.y = (this->direction) ? 0xe000 : 0x2000; -} + // if (this->timer > 150.0) { doStateChange(&StateID_Walk); } + // this->timer = this->timer + 1.0; + // } + // void daMegaGoomba_c::endState_Launch() { + // //rot.y = (this->direction) ? 0xe000 : 0x2000; + // } // Jump State -void daMegaGoomba_c::beginState_Jump() { - this->timer = 1.0; - - //Variables for choosing a curve - float jump_height = this->JumpHeight; - float delta = (this->direction) ? -JumpDist : JumpDist; - float fullTime = this->JumpTime; - //Key count - Xkey_count = 2; - Ykey_count = 3; - - //Initial Position - keysX[0] = (HermiteKey){ 0.0, this->pos.x, 0.0 }; - keysY[0] = (HermiteKey){ 0.0, this->pos.y, 0.8 }; - - //Middle Position - keysY[1] = (HermiteKey){ (fullTime/2.0), this->pos.y + jump_height, 0.0 }; - - //End Position - keysX[1] = (HermiteKey){ fullTime, this->pos.x + delta, 0.0 }; - keysY[2] = (HermiteKey){ fullTime, this->pos.y, 0.8 }; - - // using this to stop walk animation - this->animationChr.setCurrentFrame(900.0); -} -void daMegaGoomba_c::executeState_Jump() { + // void daMegaGoomba_c::beginState_Jump() { + // this->timer = 1.0; + + // //Variables for choosing a curve + // float jump_height = this->JumpHeight; + // float delta = (this->direction) ? -JumpDist : JumpDist; + // float fullTime = this->JumpTime; + // //Key count + // Xkey_count = 2; + // Ykey_count = 3; + + // //Initial Position + // keysX[0] = (HermiteKey){ 0.0, this->pos.x, 0.0 }; + // keysY[0] = (HermiteKey){ 0.0, this->pos.y, 0.8 }; + + // //Middle Position + // keysY[1] = (HermiteKey){ (fullTime/2.0), this->pos.y + jump_height, 0.0 }; + + // //End Position + // keysX[1] = (HermiteKey){ fullTime, this->pos.x + delta, 0.0 }; + // keysY[2] = (HermiteKey){ fullTime, this->pos.y, 0.8 }; + + // // using this to stop walk animation + // this->animationChr.setCurrentFrame(900.0); + // } + // void daMegaGoomba_c::executeState_Jump() { - this->pos.x = GetHermiteCurveValue(this->timer, this->keysX, Xkey_count); - this->pos.y = GetHermiteCurveValue(this->timer, this->keysY, Ykey_count); + // this->pos.x = GetHermiteCurveValue(this->timer, this->keysX, Xkey_count); + // this->pos.y = GetHermiteCurveValue(this->timer, this->keysY, Ykey_count); - float TimerMax = JumpTime + 1.0; - if (this->timer > TimerMax) { - doStateChange(&StateID_Walk); - } + // float TimerMax = JumpTime + 1.0; + // if (this->timer > TimerMax) { + // doStateChange(&StateID_Walk); + // } - this->timer = this->timer + 1.0; + // this->timer = this->timer + 1.0; -} -void daMegaGoomba_c::endState_Jump() { } + // } + // void daMegaGoomba_c::endState_Jump() { } // Turn State |