Major momentum changes

main
sunsetbear 4 years ago
parent 07b4173ffa
commit 44dfdb2ee4

@ -48,7 +48,11 @@ if (state == STANDING || state == RUNNING) {
idle = 0; idle = 0;
if (position_meeting(x - 7, y - 8, oSolid) == false && position_meeting(x - 7, y - 24, oSolid) == false) { if (position_meeting(x - 7, y - 8, oSolid) == false && position_meeting(x - 7, y - 24, oSolid) == false) {
if (!inwater && waterfall == 0 || global.currentsuit == 2) { if (!inwater && waterfall == 0 || global.currentsuit == 2) {
if (statetime < 2) xVel = -2.4; if (statetime <= 5 && kLeft > 0 && turning = 0 && state == RUNNING){
xVel = -2.2;
//xAcc = -2.4;
xFric = 1;
}
//hspeed = 0; //hspeed = 0;
if (statetime <= 5) xAcc -= runAcc / 8; if (statetime <= 5) xAcc -= runAcc / 8;
if (statetime > 5) { if (statetime > 5) {
@ -99,7 +103,11 @@ if (state == STANDING || state == RUNNING) {
idle = 0; idle = 0;
if (position_meeting(x + 7, y - 8, oSolid) == false && position_meeting(x + 7, y - 24, oSolid) == false) { if (position_meeting(x + 7, y - 8, oSolid) == false && position_meeting(x + 7, y - 24, oSolid) == false) {
if (!inwater && waterfall == 0 || global.currentsuit == 2) { if (!inwater && waterfall == 0 || global.currentsuit == 2) {
if (statetime < 2) xVel = 2.4; if (statetime <= 5 && turning = 0 && kRight > 0 && state == RUNNING){
//xAcc = 2.4;
xVel = 2.2;
xFric = 1;
}
//hspeed = 0; //hspeed = 0;
if (statetime <= 5) xAcc += runAcc / 8; if (statetime <= 5) xAcc += runAcc / 8;
if (statetime > 5) { if (statetime > 5) {
@ -141,12 +149,16 @@ if (state == STANDING || state == RUNNING) {
} // if (state == STANDING || state == RUNNING) } // if (state == STANDING || state == RUNNING)
//below is walljump code //below is walljump code
//NOTE: OTHER AIR RELATED CODE IS HERE LOL ! //NOTE: OTHER AIR STATE CODE IS HERE LOL !
if (platformCharacterIs(IN_AIR)) { if (platformCharacterIs(IN_AIR)) {
if (state == DREADSLIDE){ if (state == DREADSLIDE){
state = JUMPING; state = JUMPING;
vjump = 1; vjump = 1;
} }
if (vjump == 1){
dash = 0;
speedboost = 0;
}
if (yVel < 0 && kJump == 0 && state != AIRBALL) yVel = 0; if (yVel < 0 && kJump == 0 && state != AIRBALL) yVel = 0;
if (yVel < 0 && kJump == 0 && state == AIRBALL) { if (yVel < 0 && kJump == 0 && state == AIRBALL) {
if (fixedy == 0 && ballbounce == 0) yVel = 0; if (fixedy == 0 && ballbounce == 0) yVel = 0;
@ -514,7 +526,7 @@ if (state == BALL || state == AIRBALL) {
image_index = 0; image_index = 0;
} }
if (dash > 0) { if (dash == 45) {
sjball = 1; sjball = 1;
if (state == BALL && (facing == RIGHT && kRight == 0 || facing == LEFT && kLeft == 0)) { if (state == BALL && (facing == RIGHT && kRight == 0 || facing == LEFT && kLeft == 0)) {
dash = 0; dash = 0;
@ -668,6 +680,7 @@ if (state == SJSTART) {
statetime = 0; statetime = 0;
image_index = 0; image_index = 0;
sfx_loop(sndSJLoop); sfx_loop(sndSJLoop);
sfx_play(sndSBSonicBoom);
} }
} // if (state == SJSTART) } // if (state == SJSTART)
if (state == SUPERJUMP) { if (state == SUPERJUMP) {
@ -732,8 +745,8 @@ if (state == SUPERJUMP) {
dash = 44; dash = 44;
sfx_stop(sndSJLoop); sfx_stop(sndSJLoop);
if (facing == RIGHT) { if (facing == RIGHT) {
xVel = 7.4; xVel = 9;
} else xVel = -7.4; } else xVel = -9;
shinespark = 4; shinespark = 4;
} }
if (sjball == 1) { if (sjball == 1) {
@ -747,8 +760,8 @@ if (state == SUPERJUMP) {
sfx_stop(sndSJLoop); sfx_stop(sndSJLoop);
alarm[2] = 30; alarm[2] = 30;
if (facing == RIGHT) { if (facing == RIGHT) {
xVel = 7.4; xVel = 9;
} else xVel = -7.4; } else xVel = -9;
shinespark = 4; shinespark = 4;
} }
} }
@ -2005,21 +2018,27 @@ if (state == STANDING && kRight == 0 && kLeft == 0){
xFric = 0; xFric = 0;
} }
if (state == RUNNING) { if (state == RUNNING) {
if (statetime > 5) {
if (dash == 0) xFric = frictionRunningX; if (dash == 0) xFric = frictionRunningX;
if (dash > 0 && dash <= 25) xFric = frictionRunningX + dash * 0.0065; if (dash > 0 && dash <= 25) xFric = frictionRunningX + dash * 0.0065;
if (dash >25 && dash <=39) xFric = frictionRunningX + 25 * 0.0065; if (dash >25 && dash <=39) xFric = frictionRunningX + 25 * 0.0065;
if (dash > 39 && dash <= 45) xFric = frictionRunningX + dash * 0.006; if (dash > 39 && dash <= 45) xFric = frictionRunningX + dash * 0.006;
if (turning == 1) xFric = 0; if (turning == 1) xFric = 0;
if (shinespark) xFric = 1; if (shinespark) xFric = 1;
} else {
xFric = 1;
}
} }
if (state == BRAKING) xFric = frictionRunningX * 2.8; if (state == BRAKING) xFric = frictionRunningX * 2.8;
if (state == SUPERJUMP) xFric = 1; if (state == SUPERJUMP) xFric = 1;
if (state == BALL) { if (state == BALL) {
if (dash == 0) xFric = frictionRunningX * 2; if (dash == 0) xFric = frictionRunningX * 2;
if (dash > 0 && dash <= 25) xFric = frictionRunningX + dash * 0.03; if (dash > 0 && speedboost == 0){
if (dash >25 && dash <=39) xFric = frictionRunningX + 25 * 0.03; if (dash > 0 && dash <= 25) xFric = frictionRunningX + dash * 0.0065 * 2;
if (dash > 39 && dash <= 45) xFric = frictionRunningX + dash * 0.015; if (dash >25 && dash <=39) xFric = frictionRunningX + 25 * 0.0065 * 2;
if (shinespark) xFric = 0.8; if (dash > 39 && dash <= 45) xFric = frictionRunningX + dash * 0.006 * 2;
}
if (shinespark) xFric = 1;
} }
if (state == AIRBALL) { if (state == AIRBALL) {
xFric = 0.5; xFric = 0.5;
@ -2570,8 +2589,8 @@ if (state != IDLE && state != SAVING && state != SAVINGFX && state != SAVINGSHIP
//Custom code start //Custom code start
if !global.speedbooster && dash > 25 { if !global.speedbooster && dash > 27 {
dash = 25; dash = 27;
} }
if (xVelStoredTimer > 0) { if (xVelStoredTimer > 0) {
@ -2624,7 +2643,16 @@ if platformCharacterIs(IN_AIR) {
} }
if (slideCooldown > 0) slideCooldown -= 1 if (slideCooldown > 0) slideCooldown -= 1
if machball > 0 && state == BALL && (kRight > 0 || kLeft > 0){ if machball > 0 && state == BALL && (kRight > 0 || kLeft > 0){
xVel = airStoredXvel; if (airStoredXvel > 6 && kLeft > 0){
xVel = (airStoredXvel);
} else {
xVel = 6;
}
if (airStoredXvel < -6 && kRight > 0){
xVel = (airStoredXvel);
} else {
xVel = -6;
}
//LoopSoundMono(sndChargeLoop); //LoopSoundMono(sndChargeLoop);
if xVel > 0 && kLeft > 0 { if xVel > 0 && kLeft > 0 {
xVel = 0; xVel = 0;
@ -2636,9 +2664,13 @@ if machball > 0 && state == BALL && (kRight > 0 || kLeft > 0){
} }
} }
if state != BALL { if (state != BALL) {
machball = 0; machball = 0;
} }
if (machball > 0 && kRight > 0 && kLeft > 0 ){
machball = 0;
dash = 0;
}
if (dash > 40 && dash < 41 && state == RUNNING){ if (dash > 40 && dash < 41 && state == RUNNING){
sfx_play(sndSBStart); sfx_play(sndSBStart);
} }

Loading…
Cancel
Save