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 7635289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:23:48+00:00 2026-05-31T07:23:48+00:00

I am programming a side-scrolling game. I want to be able to control the

  • 0

I am programming a side-scrolling game.
I want to be able to control the speed of the endless side-scrolling background relative to the speed and position the player is moving at.

I want to know how to do a few things:

  • Like, if the player is running, the background scrolls faster. If the
  • Player is walking, the background scrolls slower. If the player isn’t
  • Moving, the background shouldn’t be moving. If the it is at the start
  • Or end of the level, the background should stop moving too.

Anyone can give me insight on how to do this?

  • 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-05-31T07:23:49+00:00Added an answer on May 31, 2026 at 7:23 am

    There’s a simple formula that can do this for you:

    Adjust the position of the background elements to be a percentage of the foreground elements. The lower the percentage, the slower they will move with the rest of the game.

    Sample:

    background.x = player.x * 0.2;
    background.y = player.y * 0.2;
    

    The background will always move at 20% of the speed of the player. When the player moves 200 pixels, the background will only scroll 40 pixels.

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

Sidebar

Related Questions

I'm trying to make an easy side scrolling game just to learn the ropes
I have heard that old arcade side scrolling games used a specific programming hack
When programming in Eclipse I use small vertical bar on the right side of
I am new to the locating hardware side of embedded programming and so after
I'm writing a simple program that will run entirely client-side. (Desktop programming? do people
I'm kinda new at both programming, and WPF. I know that this is pretty
Through the past few years I've been busy with server side programming and I
I am a perl developer that has never went into the client side programming
If I want to use ASP.Net without the Microsoft AJAX Control Toolkit or JQuery
Are there client side programming languages other than JavaScript in web development?

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.