diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-07-20 15:10:14 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-07-20 15:10:14 -0500 |
commit | 2d39f19d92673bb9a8f12a71bbd6d86dd2166237 (patch) | |
tree | ae0c64dd5329b42564c00ecb990b956467addea0 /src/koopatlas/player.cpp | |
parent | 7db25a9cb78f98d57fa0e386eb4a14c2842d52e7 (diff) | |
download | kamek-2d39f19d92673bb9a8f12a71bbd6d86dd2166237.tar.gz kamek-2d39f19d92673bb9a8f12a71bbd6d86dd2166237.zip |
Bugfix to the hud, added in player animations for path movement
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/player.cpp | 154 |
1 files changed, 89 insertions, 65 deletions
diff --git a/src/koopatlas/player.cpp b/src/koopatlas/player.cpp index f8e491a..c6820a0 100644 --- a/src/koopatlas/player.cpp +++ b/src/koopatlas/player.cpp @@ -17,6 +17,13 @@ int daWMPlayer_c::onCreate() { current_param = 0; + hasEffect = false; + hasSound = false; + step = false; + effectName = ""; + soundName = 0; + timer = 0; + return true; } @@ -31,77 +38,94 @@ int daWMPlayer_c::onExecute() { this->modelHandler->update(); this->modelHandler->setSRT(this->pos, this->rot, this->scale); -#ifdef MARIO_OPTIONS - // Before we leave, do the debug movement stuff - int heldButtons = Remocon_GetButtons(GetActiveRemocon()); - int nowPressed = Remocon_GetPressed(GetActiveRemocon()); - char buf[100]; - bool updated = false; - if (nowPressed & WPAD_LEFT) { - current_param--; - updated = true; - } + if (hasEffect) { effect.spawn(effectName, 0, &pos, &rot, &scale); } - if (nowPressed & WPAD_RIGHT) { - current_param++; - updated = true; - } + if (hasSound) { + timer++; - if (current_param < 0) - current_param = 8; - - if (current_param > 8) - current_param = 0; - - float pos_mod = 0.0f; - short rot_mod = 0.0f; - float scale_mod = 0.0f; - if (nowPressed & WPAD_ONE) { - pos_mod -= 5.0f; - rot_mod -= 0x1000; - scale_mod -= 0.1f; - updated = true; - } else if (nowPressed & WPAD_TWO) { - pos_mod += 5.0f; - rot_mod += 0x1000; - scale_mod += 0.1f; - updated = true; - } + if (timer == 10) { + if (step) { MapSoundPlayer(SoundRelatedClass, soundName, 1); step = false; } + else { MapSoundPlayer(SoundRelatedClass, soundName+1, 1); step = true; } + timer = 0; + } - if (!updated) return true; - - if (current_param == 0) { - pos.x += pos_mod; - sprintf(buf, "X position: %f", pos.x); - } else if (current_param == 1) { - pos.y += pos_mod; - sprintf(buf, "Y position: %f", pos.y); - } else if (current_param == 2) { - pos.z += pos_mod; - sprintf(buf, "Z position: %f", pos.z); - } else if (current_param == 3) { - rot.x += rot_mod; - sprintf(buf, "X rotation: 0x%04x", rot.x); - } else if (current_param == 4) { - rot.y += rot_mod; - sprintf(buf, "Y rotation: 0x%04x", rot.y); - } else if (current_param == 5) { - rot.z += rot_mod; - sprintf(buf, "Z rotation: 0x%04x", rot.z); - } else if (current_param == 6) { - scale.x += scale_mod; - sprintf(buf, "X scale: %f", scale.x); - } else if (current_param == 7) { - scale.y += scale_mod; - sprintf(buf, "Y scale: %f", scale.y); - } else if (current_param == 8) { - scale.z += scale_mod; - sprintf(buf, "Z scale: %f", scale.z); + if (timer > 10) { timer = 0; } } - dScNewerWorldMap_c::instance->SetTitle(buf); -#endif + + +// #ifdef MARIO_OPTIONS +// // Before we leave, do the debug movement stuff +// int heldButtons = Remocon_GetButtons(GetActiveRemocon()); +// int nowPressed = Remocon_GetPressed(GetActiveRemocon()); +// char buf[100]; +// bool updated = false; + +// if (nowPressed & WPAD_LEFT) { +// current_param--; +// updated = true; +// } + +// if (nowPressed & WPAD_RIGHT) { +// current_param++; +// updated = true; +// } + +// if (current_param < 0) +// current_param = 8; + +// if (current_param > 8) +// current_param = 0; + +// float pos_mod = 0.0f; +// short rot_mod = 0.0f; +// float scale_mod = 0.0f; +// if (nowPressed & WPAD_ONE) { +// pos_mod -= 5.0f; +// rot_mod -= 0x1000; +// scale_mod -= 0.1f; +// updated = true; +// } else if (nowPressed & WPAD_TWO) { +// pos_mod += 5.0f; +// rot_mod += 0x1000; +// scale_mod += 0.1f; +// updated = true; +// } + +// if (!updated) return true; + +// if (current_param == 0) { +// pos.x += pos_mod; +// sprintf(buf, "X position: %f", pos.x); +// } else if (current_param == 1) { +// pos.y += pos_mod; +// sprintf(buf, "Y position: %f", pos.y); +// } else if (current_param == 2) { +// pos.z += pos_mod; +// sprintf(buf, "Z position: %f", pos.z); +// } else if (current_param == 3) { +// rot.x += rot_mod; +// sprintf(buf, "X rotation: 0x%04x", rot.x); +// } else if (current_param == 4) { +// rot.y += rot_mod; +// sprintf(buf, "Y rotation: 0x%04x", rot.y); +// } else if (current_param == 5) { +// rot.z += rot_mod; +// sprintf(buf, "Z rotation: 0x%04x", rot.z); +// } else if (current_param == 6) { +// scale.x += scale_mod; +// sprintf(buf, "X scale: %f", scale.x); +// } else if (current_param == 7) { +// scale.y += scale_mod; +// sprintf(buf, "Y scale: %f", scale.y); +// } else if (current_param == 8) { +// scale.z += scale_mod; +// sprintf(buf, "Z scale: %f", scale.z); +// } + +// dScNewerWorldMap_c::instance->SetTitle(buf); +// #endif return true; } |