Wall jumping

Discuss programming in the QuakeC language.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Post by r00k »

Testing your mod, it stopped me when i touched the wall,
but here's the fix for ya I tested it and it works fine...

Code: Select all

void () player_touch =
{
	if ((other.solid == SOLID_BSP) && (self.button2))
	{
		if ((time > self.timetojump) && ((time > self.timetojump2)))
		{
			if ((!self.flags & FL_ONGROUND)) self.flags = self.flags + FL_ONGROUND;
			self.velocity = (self.velocity * 1.5);
			self.timetojump2 = time + 0.5;
			return;
		}
	}
};

Code: Select all

void() PlayerJump =
{
	if (self.flags & FL_WATERJUMP)
	return;

	if (self.waterlevel >= 2)
	{
		if (self.watertype == CONTENT_WATER)
		self.velocity_z = 100;
		else if (self.watertype == CONTENT_SLIME)
		self.velocity_z = 80;
		else
		self.velocity_z = 50;

		// play swiming sound
		if (self.swim_flag < time)
		{
			self.swim_flag = time + 1;
			if (random() < 0.5)
			sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM);
			else
			sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM);
		}

		return;
	}


	if (!(self.flags & FL_ONGROUND))
	{
		return;// already in air...
	}

	if ( !(self.flags & FL_JUMPRELEASED) )
	{
		return; // don't pogo stick
	}


	self.flags = self.flags - (self.flags & FL_JUMPRELEASED);

	self.flags = self.flags - FL_ONGROUND;	// don't stairwalk

	self.button2 = 0;
	// player jumping sound
	sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);	

	self.timetojump = time + (0.2);

	HarblTron ();
};
Cool mod so far! Hope this helps you out!
-R00k
Post Reply