summaryrefslogtreecommitdiff
path: root/src/shyguy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shyguy.cpp')
-rw-r--r--src/shyguy.cpp77
1 files changed, 30 insertions, 47 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index bf54c64..36072b8 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -617,6 +617,7 @@ int daShyGuy::onCreate() {
doStateChange(&StateID_RealWalk);
}
else if (type == 1) {
+ bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
doStateChange(&StateID_Walk);
}
else if (type == 2) {
@@ -668,6 +669,7 @@ int daShyGuy::onCreate() {
doStateChange(&StateID_RealWalk);
}
else if (type == 10) {
+ bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
doStateChange(&StateID_Walk);
}
@@ -747,7 +749,6 @@ void daShyGuy::updateModelMatrices() {
// Walk State
///////////////
void daShyGuy::beginState_Walk() {
- bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
this->timer = 0;
this->rot.y = (direction) ? 0xD800 : 0x2800;
@@ -759,13 +760,12 @@ void daShyGuy::updateModelMatrices() {
this->pos.x += (direction) ? -0.5 : 0.5;
+ if (this->timer > (this->distance * 32)) {
+ doStateChange(&StateID_Turn);
+ }
+
if(this->chrAnimation.isAnimationDone())
- if (this->timer > (this->distance * 32)) {
- doStateChange(&StateID_Turn);
- }
- else {
- this->chrAnimation.setCurrentFrame(0.0);
- }
+ this->chrAnimation.setCurrentFrame(0.0);
this->timer = this->timer + 1;
}
@@ -776,12 +776,15 @@ void daShyGuy::updateModelMatrices() {
// Turn State
///////////////
void daShyGuy::beginState_Turn() {
- bindAnimChr_and_setUpdateRate("c18_IDLE_R", 1, 0.0, 1.0);
+ // bindAnimChr_and_setUpdateRate("c18_IDLE_R", 1, 0.0, 1.0);
this->direction ^= 1;
this->speed.x = 0.0;
}
void daShyGuy::executeState_Turn() {
+ if(this->chrAnimation.isAnimationDone())
+ this->chrAnimation.setCurrentFrame(0.0);
+
u16 amt = (this->direction == 0) ? 0x2800 : 0xD800;
int done = SmoothRotation(&this->rot.y, amt, 0x800);
@@ -1109,24 +1112,24 @@ void daShyGuy::updateModelMatrices() {
spawned->speed.y = 2.0;
}
- if (spikeTurn == 0) {
- if (this->spikeA != 0) {
- PlaySound(spikeA, SE_OBJ_ROCK_S_CRASH);
- CreateEffect(&(Vec){this->spikeA->pos.x, this->spikeA->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
- this->spikeA->Delete(this->spikeA->_390);
- }
- this->spikeA = spawned;
- spikeTurn = 1;
- }
- else {
- if (this->spikeB != 0) {
- PlaySound(spikeB, SE_OBJ_ROCK_S_CRASH);
- CreateEffect(&(Vec){this->spikeB->pos.x, this->spikeB->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
- this->spikeB->Delete(this->spikeB->_390);
- }
- this->spikeB = spawned;
- spikeTurn = 0;
- }
+ // if (spikeTurn == 0) {
+ // if (this->spikeA != 0) {
+ // PlaySound(spikeA, SE_OBJ_ROCK_S_CRASH);
+ // CreateEffect(&(Vec){this->spikeA->pos.x, this->spikeA->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
+ // this->spikeA->Delete(this->spikeA->_390);
+ // }
+ // this->spikeA = spawned;
+ // spikeTurn = 1;
+ // }
+ // else {
+ // if (this->spikeB != 0) {
+ // PlaySound(spikeB, SE_OBJ_ROCK_S_CRASH);
+ // CreateEffect(&(Vec){this->spikeB->pos.x, this->spikeB->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
+ // this->spikeB->Delete(this->spikeB->_390);
+ // }
+ // this->spikeB = spawned;
+ // spikeTurn = 0;
+ // }
// spawned->_320 = 0.0f;
// spawned->_324 = 8.0f;
@@ -1400,27 +1403,7 @@ void daShyGuy::updateModelMatrices() {
calculateTileCollisions();
if(this->chrAnimation.isAnimationDone()) {
- if (type == 0) {
- doStateChange(&StateID_RealWalk);
- }
- else if (type == 1) {
- doStateChange(&StateID_Walk);
- }
- else if (type == 2) {
- doStateChange(&StateID_RealWalk);
- }
- else if (type == 3) {
- doStateChange(&StateID_Jump);
- }
- else if (type == 4) {
- doStateChange(&StateID_Judo);
- }
- else if (type == 5) {
- doStateChange(&StateID_Spike);
- }
- else {
- doStateChange(&StateID_RealWalk);
- }
+ doStateChange(&StateID_RealWalk);
}
}
void daShyGuy::endState_Recover() {