C# move to a random Y position at the bottom of screen. (HOW?)

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="font-size:small <span style="font-size:small

<span style="font-size:small <span style="font-size:small




<span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small Vector3<span style="font-size:small <span style="font-size:small tokenPosition =
<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small this<span style="font-size:small <span style="font-size:small .PossessedToken.Position;
<span style="font-size:small <span style="font-size:small
tokenPosition.Y = tokenPosition.Y + mSpeed;




<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small this<span style="font-size:small <span style="font-size:small .PossessedToken.Position = tokenPosition;
<span style="font-size:small <span style="font-size:small




<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small this<span style="font-size:small <span style="font-size:small .PossessedToken.Orientation =
<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small new<span style="font-size:small <span style="font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small Vector3<span style="font-size:small <span style="font-size:small (mFacingDirection,
<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small this<span style="font-size:small <span style="font-size:small .PossessedToken.Orientation.Y,
<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small this<span style="font-size:small <span style="font-size:small .PossessedToken.Orientation.Z);
<span style="font-size:small <span style="font-size:small




<span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small if<span style="font-size:small <span style="font-size:small (tokenPosition.Y > 200)
<span style="font-size:small <span style="font-size:small
{
mSpeed = mSpeed * -2;
mFacingDirection = mFacingDirection * -1;
}
}
<span style="font-size:small <span style="font-size:small


This bounces my object from top to bottom, if i wanted it to once Y = 200 i want it to go to the bottom of my screen(-210) how would i go about doing that?<br/>
<br/>



View the full article
 
Back
Top