Driving Mechanics That Feel Right – Day 4 Devlog


πŸš— Devlog – Designing the Core of My 2D Car Simulator (Day 4)

This devlog is all about how I designed the driving experience from scratch. The focus? Making every little part of the car feel real, even in 2D.

πŸ”§ Gears That Actually Work

The gear system isn’t just for show. Shifting gears affects your speed, acceleration, and driving flow. Each gear comes with its own behavior—1st is slow and controlled, 3rd opens up more speed. You can even shift into reverse.

python:
if keys[pygame.K_LSHIFT] and keys[pygame.K_1]:    
       gear_no = 1 

πŸ’‘ Indicator Logic

This was a fun detail to work on. The indicators toggle with the A and D keys and even blink like real ones. If you make a turn and straighten the wheel, the indicators turn off automatically—just like a real car.

python:
if indicator_on and wheel_angle == 0 and degree_check:   
    indicator_on = False      
    visible = False            
    degree_check = False  

πŸ•ΉοΈ Speedometer with a Needle

The speedometer shows your car’s speed with a rotating needle that scales based on your current gear and acceleration. It’s a small detail but makes the dashboard feel alive.

python:
displayed_speed = car_speed * (5.6 if gear_no == 1 else 6.9 if gear_no == 2 else 7.9 if gear_no == 3 else ...): 

I’m still working on more features (like RPM and autopilot), but for now I’m happy with how the car feels to drive.

If you want to try it or follow along the journey, check it out on Itch.io:

πŸ”— Play it on Itch.io

Files

car simulator 2d 59 MB
7 days ago

Get car simulator (2D)

Leave a comment

Log in with itch.io to leave a comment.