Mark

Mark

  • NA
  • 2
  • 0

C#: Need "between" conditional operator substitute

Jan 8 2010 5:57 PM

I know there is no "between" keyword in c sharp,so I need some help. I'm trying to calculate this formula

if (x < pad.x && y is between pad.y and (pad.y + 100))
 
{
                 bounced
= true;
                _velocity
.Y = -_velocity.Y;
                _position
.Y = _position.Y + _velocity.Y;
                _velocity
.X = -_velocity.X;
                _position
.X = _position.X + _velocity.X;
}


thanks

Answers (2)