What is the best location to find tutorials on physics in game development?

后端 未结 2 1303
时光说笑
时光说笑 2021-02-09 19:03

I\'m very new to game development (iPhone/iPad specifically, if that matters at all) and am having a tough time with working with the physics part of animation. Specifically I\'

2条回答
  •  情话喂你
    2021-02-09 19:12

    Since you are new to game dev, I would not recommend writing your own physics code if your game is relatively complex. I have two reasons for saying this:

    1. You need to know how to separate physics from game logic, in order to ensure the stability of the physics while maximizing flexibility of game logic.
    2. There are many pitfalls when it comes to designing a physics engine with collision detection, many of which have been solved in existing physics engines.

    If you are still set on writing your own physics, I recommend starting by creating a sandbox application with a good existing physics engine. Look at what parts of the physics engine are exposed, and what parts you would like to have exposed. Next, dig into the physics code to see how the objects are updated according to velocity, simulation gravity, mass, friction, etc. See how collision is detected, and how the engine deals with things like tunneling and collision response for extreme cases.

    Box2D is well-written open-source physics engine, and is included in Cocos2D. You can create a Box2D game template and jump right into it.

提交回复
热议问题