Here I updated your code with your help. Anyway, it still does not follow the delay to Mount Pointer.
The balloon (Sprite) is flying in triumph and since the mouse pointer is not stopped, only keep moving slowly, and then increase the speed I have added a condition, once the balloon has been posted The mouse is equal to the indicator, velocity = 0, but it does not prevent the balloon.
I have added a part of the code to keep the balloon (phantom) in the screen.
Protected Override Zero Update (GameTime GameTime) {MouseState PresentMostet = Mouse Gatestate (); // Gubbarption = New Vector 2 (current Moustest.X, Cholovazestat.Y); // system Windows.InputMasterStateCoolOmissState = System. Windows.input.mouse Gatestate (); // Get the position of the current mouse vector 2 mouseposition = new vector 2 (current moustetext.x, runhousehouse.it); // Get distance between balloon and mouse float distance = vector 2. Distance (mouseposition, ballonposition); // You can change the standard velocity / or maximum distance to run at fast speed or slow speed. // At present, it may be faster or slow to find a difference for you balloon = standard distinction * * (distance / maxdistance); // Set the balloon position to the new velocity BalloonPosition + = BalloonAge; If (subdivision == mouseposition) {Bululuvelocity = new vector 2 (0); } // Keep the balloon in the screen if (Gubernoopo.XX & # 39; balloon with / 2) balloon. Xx = Balloon. With / 2; If (balloonPosition.Y & lt; balloon.Height / 2) balloonPosition.Y = balloon Height / 2; If (Balloon X. Window; Closed Boundary - Balloon with W / 2) Balloon. Composition = X. window. Client Bounds. Wide - Balloon With / 2; If (balloonPosition.Y> window. Clientband.Hight - balloon.height / 2) balloon promotion. Y = window Clientbound.height; }
nepozy = vector 2 Lirrup (current, desired position, speed);
Comments
Post a Comment