Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DarkHunter

HELP!!!

This topic is 6152 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

what is wrong with this code!!!!
  
if(keys['S'] && !sp)
{
	sp = true;
	spin = !spin;
}
if (!keys['S'])
{
	sp = false;
}

if(spin = false)
{			// Slow Down if not in spin mode

	

	if (xspeed > 0.0)			
	{
		xspeed -= .0005;				
	}
	if (yspeed > 0.0)
	{
		yspeed -= .0005;
	}
	if (xspeed < 0.0)
	{
		xspeed += .0005;
	}
	if (yspeed < 0.0)
	{
		yspeed += .0005;
	}
}
	xrot += xspeed;
	yrot += yspeed;
  
if in spin mode, it countinously spins, if spin is false it has to slow itslef down, simple as that! but it wont work. Edited by - DarkHunter on November 18, 2001 7:31:54 PM

Share this post


Link to post
Share on other sites
Advertisement
One of the oldest and simplest problems from the looks of it:

if (spin = false)

should be

if (spin == false)
or
if (!spin)

easy mistake to make - hard to spot!

EDIT:

Fruny - you beat me to it by 59 seconds!

Edited by - Enigma on November 18, 2001 7:35:50 PM

Share this post


Link to post
Share on other sites
Well, since you aren''t saying how exactly it isn''t working, I can only guess that your problem is
if(spin = false)

This should be spin == false. (assuming you just copy/pasted it and didn''t make a mistake typing in your code here)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!