Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Vector3 Position X animation
Raddy A
Oct 9 2011 7:41 AM
1.7k
Reply
I want to make my vector go right till it hits 300 X and then come back to the point where it started smoothly.
The code I have makes my vector to go smoothly to the right but I cant figure it out why its not going back....
Here is the code :)
public override void Update(ref GameTime pGameTime)
{
Vector3 tokenPosition = this.PossessedToken.Position;
tokenPosition.X = tokenPosition.X + 1;
this.PossessedToken.Position = tokenPosition;
if (tokenPosition.X > 300)
{
Vector3 tokenPosition1 = this.PossessedToken.Position;
tokenPosition1.X = tokenPosition1.X - 1;
this.PossessedToken.Position = tokenPosition1;
}
}
#endregion
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
XNA Reference enabling
Load XML file from XNA