Tutorial *111*
Bobbing Weapons
Possibly the quickest and cheapest tutorial in the world for Quake 1. Don't blink you might miss it ;)

Do you like the item 'bobbing' effect that JohnC added to Q3?

Well I do, so I added it to Q1.

In CL_MAIN.C, find the lines that say :-



// rotate binary objects locally
if (ent->model->flags & EF_ROTATE) ent->angles[1] = bobjrotate;


and replace with this :-



// rotate binary objects locally

		if (ent->model->flags & EF_ROTATE)

		{

			ent->angles[1] = bobjrotate;

			// MUFF - makes them bob as well as rotate ;)

			ent->origin[2] += (( sin(bobjrotate/90*M_PI) * 5) + 5 );

		}

And that should be it.

Compile and run.

You should now have items that bob whilst rotating.

Enjoy,

Muff



 
Not logged in
Sign up
Login:
Passwd: