Giter Site home page Giter Site logo

Comments (5)

complyue avatar complyue commented on May 20, 2024

if (groundSpeed < 1f && !turboOn) {
Box2DUtils.applyDrag(mBody, (1 - groundSpeed) * GP.groundDragFactor);
}

Also confused here why groundSpeed < 1f? I'd perceive 1 as a very small speed, is that the case? So the drag force only applies when it nearly stopped, so as to get it to completely still?

from pixelwheels.

agateau avatar agateau commented on May 20, 2024

Seems there will always be some force applied to the wheel, then how it actually get max speed limited?

That's a good question indeed. It's been a long time since I wrote this code, but playing with it a bit, if I remove the "0.2" factor the vehicles are very slow. I guess given a long enough straight road they would accelerate indefinitely. Or maybe there is a cap in Box2D. This game is the first time I use a physics engine, and I sometimes don't fully understand what's happening under the hood (or I dive in to understand, manage to understand, then a few weeks later I have forgotten about it...)

Also confused here why groundSpeed < 1f? I'd perceive 1 as a very small speed, is that the case?

No, groundSpeed is a "normalized" speed, where 1 means normal, no change, <1 means slow down (sand, grass, water tiles), >1 means speed up (turbo tiles). See Material.getSpeed() for the actual values. The material of a tile is defined in the .tsx files defining the tiles (in android/assets/maps). You can look at them using Tiled.

from pixelwheels.

agateau avatar agateau commented on May 20, 2024

Forgot to add: there already is a catch up mode. AI players ahead of the player are slowed down if they are better ranked, see AIPilot.updateAcceleration().

from pixelwheels.

complyue avatar complyue commented on May 20, 2024

I created #437 to experiment with the idea, shall we move the discussion to there and close this issue?

from pixelwheels.

agateau avatar agateau commented on May 20, 2024

I created #437 to experiment with the idea, shall we move the discussion to there and close this issue?

Sure.

from pixelwheels.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.