Created
December 8, 2012 14:37
-
-
Save IlyaEremin/4240483 to your computer and use it in GitHub Desktop.
2 Polina
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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