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

  • SEARCH
  • Home
  • 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 8909899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:33:08+00:00 2026-06-15T03:33:08+00:00

For the past year or so I’ve been familiarizing myself with Javascript, and in

  • 0

For the past year or so I’ve been familiarizing myself with Javascript, and in an attempt to really learn the language thoroughly I decided to make an HTML5 game! The problem i’ve run into is that I have absolutely no idea how to move an image across the screen smoothly, and at an angle. I could move it at a forty five degree angle by moving it one pixel up/down the x axis and one pixel up/down the y axis, but that’s just not specific enough. How would I go about moving it at a very specific angle? It seems to me that there would have to be a function that rounds it to the nearest pixel?

Not exactly sure… Any solution is will work fine, although a non-library specific explanation would be preferred!

Thanks!

  • 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-15T03:33:09+00:00Added an answer on June 15, 2026 at 3:33 am

    What you want to look at is a javascript implementation of Linear Interpolation (or lerp). Another name is motion tween but I believe that is more of an animation term than game development.

    The idea is that you have two coordinates, the start, and the end, and a time that for the animation to occur, and you use linear interpolation to animate between the two.

    From the Stack Question linked, this article explains a browser implementation that will allow you to do interpolation.

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

Sidebar

Related Questions

I've been on and off with the C language for the past year(?) until
I've been coding in Java for the past year, and i think I have
So I've been developing a UI toolkit for the past year, and my Window
I recently launched a website I have been developing over the past year -
I've been using Codeigniter for the past two years and really have become a
I have been developing a new online game for the past year now. The
I have been coding application from past 1 year, However first time I came
Over the past year or so I have been developing my TDD chops so
For the past year I've been working on some legacy code that was written
I've been learning Java for the past year in my free time, and so

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.