summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mrsun.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp
index 5c20169..b62228e 100755
--- a/src/mrsun.cpp
+++ b/src/mrsun.cpp
@@ -111,12 +111,13 @@ int daMrSun_c::onCreate() {
this->Baseline = this->pos.y;
this->SwoopSlope = 0.0;
this->SpiralLoop = 0;
- this->yThreshold = 100.0;
+ this->yThreshold = 15.0;
this->yAccel = 0.2;
this->timer = 0;
this->xSpiralOffset = 0.0;
this->ySpiralOffset = 0.0;
-
+
+ this->pos.z = 3300.00
OSReport("Setting Mr.Sun's State");
doStateChange(&StateID_Follow);
@@ -177,11 +178,13 @@ void daMrSun_c::executeState_Follow() {
this->speed.x = this->speed.x + speedDelta;
if (this->speed.x < 0) { this->speed.x = this->speed.x + (speedDelta / 2); }
+ if (this->speed.x < 10.0) { this->speed.x = this->speed.x + (speedDelta); }
}
else {
this->speed.x = this->speed.x - speedDelta;
if (this->speed.x > 0) { this->speed.x = this->speed.x - (speedDelta / 2); }
+ if (this->speed.x > 10.0) { this->speed.x = this->speed.x + (speedDelta); }
}
HandleXSpeed(this);
@@ -279,8 +282,8 @@ void daMrSun_c::executeState_Spiral() {
Magnitude = 11.0;
// Use a period of 0.1 for the moon
- if (this->settings == 0) { Period = 0.075; } // It's a sun
- else { Period = 0.1; } // It's a moon
+ if (this->settings == 0) { Period = 0.1; } // It's a sun
+ else { Period = 0.125; } // It's a moon
this->pos.x = this->xSpiralOffset + Magnitude*((this->SpiralLoop * cos(this->SpiralLoop)));
this->pos.y = this->ySpiralOffset + Magnitude*((this->SpiralLoop * sin(this->SpiralLoop)));
@@ -375,7 +378,7 @@ void daMrSun_c::executeState_Spin() {
else { rotBonus = 120 - this->timer; }
// this->rot.x = this->rot.x + (50 * rotBonus);
- this->rot.z = this->rot.z + (50 * rotBonus);
+ this->rot.y = this->rot.y + (50 * rotBonus);
int randomBall;
randomBall = GenerateRandomNumber(6);
@@ -387,29 +390,29 @@ void daMrSun_c::executeState_Spin() {
float ylaunch;
if (direction == 0) {
- xlaunch = 7.5;
+ xlaunch = 5.0;
ylaunch = 0.0; }
else if (direction == 1) { // SE
- xlaunch = 7.5;
- ylaunch = 7.5; }
+ xlaunch = 5.0;
+ ylaunch = 5.0; }
else if (direction == 2) { // S
xlaunch = 0.0;
- ylaunch = 7.5; }
+ ylaunch = 5.0; }
else if (direction == 3) { // SW
- xlaunch = -7.5;
- ylaunch = 7.5; }
+ xlaunch = -5.0;
+ ylaunch = 5.0; }
else if (direction == 4) { // W
- xlaunch = -7.5;
+ xlaunch = -5.0;
ylaunch = 0.0; }
else if (direction == 5) { // NW
- xlaunch = -7.5;
- ylaunch = -7.5; }
+ xlaunch = -5.0;
+ ylaunch = -5.0; }
else if (direction == 6) { // N
xlaunch = 0.0;
- ylaunch = -7.5; }
+ ylaunch = -5.0; }
else if (direction == 7) { // NE
- xlaunch = 7.5;
- ylaunch = -7.5; }
+ xlaunch = 5.0;
+ ylaunch = -5.0; }
if (this->settings == 0) {
@@ -437,7 +440,8 @@ void daMrSun_c::endState_Spin() {
this->rot.x = 11000;
this->rot.y = 0;
// this->rot.z = 11000;
-
+
+ this->speed.x = 0;
}
@@ -472,13 +476,14 @@ void daMrSun_c::executeState_Wait() {
if (this->timer > TimerMax) {
// doStateChange(&StateID_Spit);
- Choice = GenerateRandomNumber(6);
+ Choice = GenerateRandomNumber(7);
OSReport("Choice: %d", Choice);
if (Choice == 0) { doStateChange(&StateID_Spit); }
- else if (Choice == 1) { doStateChange(&StateID_Spin); }
- else if (Choice == 2) { doStateChange(&StateID_Spiral); }
+ else if (Choice == 1) { doStateChange(&StateID_Spit); }
+ else if (Choice == 2) { doStateChange(&StateID_Spin); }
+ else if (Choice == 3) { doStateChange(&StateID_Spiral); }
else { doStateChange(&StateID_Swoop); }
}