Skip to content

Instantly share code, notes, and snippets.

@IlyaEremin
Created December 8, 2012 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IlyaEremin/4240483 to your computer and use it in GitHub Desktop.
Save IlyaEremin/4240483 to your computer and use it in GitHub Desktop.
2 Polina
if (rect.Contains(Position)) // position - это координаты подростка
{
if (Position.Y < (rect.y + rect.height) && Math.Abs(Position.X -rect.x) < 30)
Velocity.X *= -1;
else if (Position.X > rect.x && Math.Abs(Position.Y - (rect.y + rect.height)) < 30)
Velocity.Y *= -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment