Is there a better way to type this code?

Hello!

/// OBS \\\
I'm new in both forum and C++ coding..


so I am looking for a better solution on this line of code!
I think you can understand what the code does?!


if( dy == 100 && dx < 700 )
	{
		dx = dx +2;
	}

	if( dx == 700 && dy < 500)
	{
		dy = dy + 2;
	}

	if( dy == 500 && dx > 100)
	{
		dx = dx - 2;
	}
	if( dx == 100 && dy > 100)
	{
		dy = dy - 2;
	}


and pleas put a comment if you think my topic is messy and how i cold have expressed my self in order for you to understand me easier. =)
1
2
3
4
dx += 2;
dy += 2;
dx -= 2;
dy -= 2;
Topic archived. No new replies allowed.