Original Post
Hi friends! I have some basic questions about physics engines, this is the first time I use one of them. Let's say I'm building a platform game using Box2D: If I want to program an enemy ( a body ) to move automatically until it collides and then turn around, I apply a force every frame ( inside my update method) and change force direction every time a collision happens. It seems to work, but my enemy accelerates to the infinity and beyond. How should I control this question? Maybe setting up linear velocity directly, but does not this avoid a proper physics simulation? I would like just my enemy have a small acceleration, and after that a constant velocity, How do it? What is the best way to managa the main character, apply force, apply linear velocity? About collisions, do you use sensors or just contact points? Thanks a lot for your time and help