Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8292335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:26:26+00:00 2026-06-08T13:26:26+00:00

My problem is getting an item to move across different screens at the same

  • 0

My problem is getting an item to move across different screens at the same speed and time. At the moment the item doesn’t move or goes way to fast. I specify two points for the item to go to and the max speed.

The Var _oneStep is my attempt to synchronize resolutions.

//Get a fraction of screen size?
_oneStep = ScreenWidth / 100;

//Delta being last update time.
public void MoveItem(double Delta)
{
    //Keep at Max speed.
    if(Math.abs(_xVelocity)  > _maxSpeed || Math.abs(_yVelocity)  > _maxSpeed)
    {
        _accelerationSpeed = 0.0001f * (_maxSpeed / _oneStep);
    }
    //Or Speed up.
    else
    {
        _accelerationSpeed = 0.00030f * (_maxSpeed / _oneStep);
    }
    //Destination is above 10% distance or below speed up or down

    _xVelocity += _accelerationSpeed * Math.cos(Math.toRadians(_degrees));
    _yVelocity += _accelerationSpeed * Math.sin(Math.toRadians(_degrees));

    _currentPosition.x += (((_xVelocity * _accelerationSpeed) + _oneStep) * Delta);
    _currentPosition.y += (((_yVelocity * _accelerationSpeed) + _oneStep) * Delta);

    CheckAtDestination();
}

Some numbers:

System.out.println("X: "+ _xVelocity + " Y: " + _yVelocity); = X: 1.0018943990787657 Y: 1.0109980390961948
System.out.println("XPos: "+ _currentPosition.x + " YPos: " + _currentPosition.x); = XPos: 36 YPos: 36
System.out.println("Degrees: " + _degrees); = Degrees: 80.22677351282063
System.out.println(Delta); = 0.3309303333093033

Also what happens if Delta turns to 1 or over? Are odd results produced?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:26:32+00:00Added an answer on June 8, 2026 at 1:26 pm

    Above code works, just make sure the _oneStep var is the screenWidth or Height (depending on your object sizes, could be screen dependent).

    So _oneStep = ScreenWidth / 100; and the Delta needs to be added to any movement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem. I'm getting an An item with the same key has
i am facing this problem here. i want to show item's name by getting
I am having a problem getting multiple attributes for one item. Below is my
item is json serialized not binary so it is readable. I am getting problem
Got a problem with a timeout when getting an item by its key in
Im having a problem getting a namespaced (Or semi-colin') item with PHP's SimpleXML. I've
I have a strange problem getting the color of the point that was touched.
I have a problem getting password_Reset_confirm bit working. url: (r'^password_reset/$', 'django.contrib.auth.views.password_reset'), (r'^password_reset_done/$', 'django.contrib.auth.views.password_reset_done'), (r'^password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
I am having a problem getting Twitter Bootstrap Carousel to begin looping automatically at
I'm having a problem getting a simple ASP.NET webpage to display. The page contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.