Saturday, September 5, 2015

c# - Help on transition from one position to another


I'm pretty sure I'm over thinking stuff, but I can't seem to figure this out. I want to move the object from one location to another. Here's what I got. I searched this up earlier here, and I found something similar, but I wasn't able to make it work. Any help would be appreciated, thanks.


//the current position of the object is at 400, 300
Vector2 nextPosition = new Vector(100, 200);
Vector2 difference = nextPosition - position;

difference.Normalize();


position += difference * 5;


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...