which is better: scrolling world or moving player?

which is better approach to developing a racing game:

  1. keep camera and player stationary, move world below player in opposite direction to supposed movement
    2 keep world stationary, and move player and camera together

if there is a third approach that would be more better, please mention that too
thanks

How would you do realistic physics with option 1?

I don’t think anyone does it in modern games.

2 is the correct approach, that way you can have other cars behaving like they should etc.

It’s also a lot easier to make.

For a racing game, Koyima is likely correct. There are some situations where holding the player still and moving the world around them make more sense because of floating point precision reasons but I suspect a race game will be fine. Moving the player and camera will almost always be the faster option no matter what.

Chris

Not to mention the fact that option 1 only allows for a single-player racing game. The moment you add a second car, what are you going to do? Both players can’t stay stationary (not if you want them to race, anyway).

there are no other cars, and its a topdown view almost 2d.I am stuck between option of making the environment move from top to bottom or move the car and camera with it

Consider all the objects you must move. They must all be in synch. Managing all those itmes can be a headache and perhaps not even better for the emgine.