mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
Implement double/triple jump.
This commit is contained in:
parent
b79de4c457
commit
ac33a869af
@ -96,7 +96,6 @@ namespace ClassicalSharp {
|
|||||||
buttons[3].Disabled = noGlobalHacks || !p.CanSpeed;
|
buttons[3].Disabled = noGlobalHacks || !p.CanSpeed;
|
||||||
buttons[4].Disabled = noGlobalHacks || !p.CanSpeed;
|
buttons[4].Disabled = noGlobalHacks || !p.CanSpeed;
|
||||||
buttons[6].Disabled = noGlobalHacks || !p.CanPushbackBlocks;
|
buttons[6].Disabled = noGlobalHacks || !p.CanPushbackBlocks;
|
||||||
buttons[4].Disabled = true; // TODO: get this working
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonWidget Make( int x, int y, string text, Action<Game, Widget> onClick,
|
ButtonWidget Make( int x, int y, string text, Action<Game, Widget> onClick,
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
<DefineConstants>TRACE;USE_DX</DefineConstants>
|
<DefineConstants>TRACE;USE_DX</DefineConstants>
|
||||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||||
<StartAction>Project</StartAction>
|
<StartAction>Project</StartAction>
|
||||||
|
<StartArguments>wwwf ver 127.0.0.1 25565</StartArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -70,12 +70,12 @@ namespace ClassicalSharp {
|
|||||||
Velocity.Y += speeding ? 0.15f : 0.10f;
|
Velocity.Y += speeding ? 0.15f : 0.10f;
|
||||||
canLiquidJump = false;
|
canLiquidJump = false;
|
||||||
} else if( onGround ) {
|
} else if( onGround ) {
|
||||||
Velocity.Y = 0;
|
|
||||||
DoNormalJump();
|
DoNormalJump();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoNormalJump() {
|
void DoNormalJump() {
|
||||||
|
Velocity.Y = 0;
|
||||||
Velocity.Y += jumpVel;
|
Velocity.Y += jumpVel;
|
||||||
if( speeding ) Velocity.Y += jumpVel;
|
if( speeding ) Velocity.Y += jumpVel;
|
||||||
if( halfSpeeding ) Velocity.Y += jumpVel / 2;
|
if( halfSpeeding ) Velocity.Y += jumpVel / 2;
|
||||||
@ -98,8 +98,11 @@ namespace ClassicalSharp {
|
|||||||
onGround = false;
|
onGround = false;
|
||||||
float multiply = GetBaseMultiply();
|
float multiply = GetBaseMultiply();
|
||||||
float modifier = LowestSpeedModifier();
|
float modifier = LowestSpeedModifier();
|
||||||
float horMul = multiply * modifier;
|
|
||||||
float yMul = Math.Max( 1f, multiply / 5 ) * modifier;
|
float yMul = Math.Max( 1f, multiply / 5 ) * modifier;
|
||||||
|
float horMul = multiply * modifier;
|
||||||
|
if( !secondJump ) { horMul *= 93f; yMul *= 10f; }
|
||||||
|
else if( !firstJump ) { horMul *= 46.5f; yMul *= 7.5f; }
|
||||||
|
|
||||||
if( TouchesAnyWater() && !flying && !noClip ) {
|
if( TouchesAnyWater() && !flying && !noClip ) {
|
||||||
MoveNormal( xMoving, zMoving, 0.02f * horMul, waterDrag, liquidGrav, yMul );
|
MoveNormal( xMoving, zMoving, 0.02f * horMul, waterDrag, liquidGrav, yMul );
|
||||||
|
@ -318,10 +318,10 @@ namespace ClassicalSharp {
|
|||||||
noClip = !noClip;
|
noClip = !noClip;
|
||||||
} else if( key == keys[KeyBinding.Jump] && !onGround ) {
|
} else if( key == keys[KeyBinding.Jump] && !onGround ) {
|
||||||
if( firstJump && CanDoubleJump && DoubleJump ) {
|
if( firstJump && CanDoubleJump && DoubleJump ) {
|
||||||
//DoNormalJump(); TODO: get this working
|
DoNormalJump();
|
||||||
firstJump = false;
|
firstJump = false;
|
||||||
} else if( secondJump && CanDoubleJump && DoubleJump ) {
|
} else if( secondJump && CanDoubleJump && DoubleJump ) {
|
||||||
//DoNormalJump(); TODO: get this working
|
DoNormalJump();
|
||||||
secondJump = false;
|
secondJump = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -58,14 +58,12 @@ namespace ClassicalSharp {
|
|||||||
bool sendHeldBlock, useMessageTypes;
|
bool sendHeldBlock, useMessageTypes;
|
||||||
int envMapApperanceVer = 2;
|
int envMapApperanceVer = 2;
|
||||||
static string[] clientExtensions = {
|
static string[] clientExtensions = {
|
||||||
"ClickDistance", "CustomBlocks", "HeldBlock",
|
"ClickDistance", "CustomBlocks", "HeldBlock", "EmoteFix", "TextHotKey", "ExtPlayerList",
|
||||||
"EmoteFix", "TextHotKey", "ExtPlayerList",
|
"EnvColors", "SelectionCuboid", "BlockPermissions", "ChangeModel", "EnvMapAppearance",
|
||||||
"EnvColors", "SelectionCuboid", "BlockPermissions",
|
"EnvWeatherType", "HackControl", "MessageTypes", "PlayerClick", "FullCP437",
|
||||||
"ChangeModel", "EnvMapAppearance", "EnvWeatherType",
|
"LongerMessages", "BlockDefinitions", "BlockDefinitionsExt",
|
||||||
"HackControl", "MessageTypes", "PlayerClick",
|
|
||||||
"FullCP437", "LongerMessages",
|
|
||||||
// proposals
|
// proposals
|
||||||
"BlockDefinitions", "BlockDefinitionsExt", "TextColors",
|
"BulkBlockUpdate", "TextColors",
|
||||||
};
|
};
|
||||||
|
|
||||||
void HandleCpeExtInfo() {
|
void HandleCpeExtInfo() {
|
||||||
@ -499,7 +497,7 @@ namespace ClassicalSharp {
|
|||||||
byte block = reader.buffer[i + bulkCount * sizeof(int)];
|
byte block = reader.buffer[i + bulkCount * sizeof(int)];
|
||||||
Vector3I coords = game.Map.GetCoords( indices[i] );
|
Vector3I coords = game.Map.GetCoords( indices[i] );
|
||||||
|
|
||||||
if( !game.Map.IsValidPos( coords ) ) {
|
if( coords.X < 0 ) {
|
||||||
Utils.LogDebug( "Server tried to update a block at an invalid position!" );
|
Utils.LogDebug( "Server tried to update a block at an invalid position!" );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -228,8 +228,8 @@ namespace ClassicalSharp.Network {
|
|||||||
HttpWebRequest MakeRequest( Request request ) {
|
HttpWebRequest MakeRequest( Request request ) {
|
||||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create( request.Url );
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create( request.Url );
|
||||||
req.AutomaticDecompression = DecompressionMethods.GZip;
|
req.AutomaticDecompression = DecompressionMethods.GZip;
|
||||||
req.ReadWriteTimeout = 15 * 1000;
|
req.ReadWriteTimeout = 90 * 1000;
|
||||||
req.Timeout = 15 * 1000;
|
req.Timeout = 90 * 1000;
|
||||||
req.Proxy = null;
|
req.Proxy = null;
|
||||||
req.UserAgent = Program.AppName;
|
req.UserAgent = Program.AppName;
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ namespace Launcher2 {
|
|||||||
protected HttpWebResponse MakeRequest( string uri, string referer, string data ) {
|
protected HttpWebResponse MakeRequest( string uri, string referer, string data ) {
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create( uri );
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create( uri );
|
||||||
request.UserAgent = Program.AppName;
|
request.UserAgent = Program.AppName;
|
||||||
request.ReadWriteTimeout = 15 * 1000;
|
request.ReadWriteTimeout = 90 * 1000;
|
||||||
request.Timeout = 15 * 1000;
|
request.Timeout = 90 * 1000;
|
||||||
request.Referer = referer;
|
request.Referer = referer;
|
||||||
request.KeepAlive = true;
|
request.KeepAlive = true;
|
||||||
request.CookieContainer = cookies;
|
request.CookieContainer = cookies;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user