Car Behavior turning speed = different soudfx?

0 favourites
  • 9 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I have a player that's controlled y the computer using the Car behavior. The car can turn at different speeds depending on the type of corner it is on, therefore acting as if it's being operated by an analog gamepad rather than a digital keyboard (where the turn speed is fixed). Is there a way of measuring how fast the car is turning, ad be able to assign different "screech" soundfx? A slow, gentle turn has a miniscreech, a full push of the joystick give a huge screen, etc?

  • You have to have different sound files for each type of screech. Then measure the angle of turn (or maybe the rate of angular turning) and play the different sound files for each subset of action.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You have to have different sound files for each type of screech. Then measure the angle of turn (or maybe the rate of angular turning) and play the different sound files for each subset of action.

    Yeah, can the rate of the turn be measured, independently from the speed of the car?

  • global number rateOfTurn=0

    global number previousAngle=0

    everytick

    --- set rateOfTurn to (sprite.angle-previousAngle)/dt

    --- set previousAngle to sprite.angle

  • global number rateOfTurn=0

    global number previousAngle=0

    everytick

    --- set rateOfTurn to (sprite.angle-previousAngle)/dt

    --- set previousAngle to sprite.angle

    Thanks! This seems to increase as the cars speed increases, is there a way to subtract the cars speed changes from the turn speed?

  • global number rateOfTurn=0

    global number previousAngle=0

    everytick

    --- set rateOfTurn to (sprite.angle-previousAngle)/dt

    --- set previousAngle to sprite.angle

    Trying again, this seems to increase as the cars speed increases, but the rate of turn appears to be the same, no matter how fast the car turns?

  • Nothing comes to mind. Reading your initial post maybe you can make the sound depend of the joystick instead of the turning rate?

  • Nothing comes to mind. Reading your initial post maybe you can make the sound depend of the joystick instead of the turning rate?

    The car is computer driven, so maybe that has something to do with it :/ Can the amount of angles changed per second be calculated somehow?

  • This seems to increase as the cars speed increases, is there a way to subtract the cars speed changes from the turn speed?

    I am sceptic about this statement. I dont see how the angle would increase with speed.

    Besides that, i dont think that is what you need. You need to know the resistance to Inertia.

    When the frontwheels are alligend with the cars angle, there is no squealing. When they differend a lot, it means the tires try to go a differend path then the car. Depending on the grip, they will squealing.

    I think you have to compare the Sprite.angle with Sprite.Car.MovingAngle. Probaly have to abs it. How bigger the difference how more squealing should happen. Got to account for the ground/grip with a factor.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)