TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2
2k
Vector3 Position X animation
Oct 9 2011 7:41 AM
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
Reply
Answers (
1
)
XNA Reference enabling
Load XML file from XNA