Force

Last, we need to consider the amount of force an object is able to exert and receive. Besides being affected by gravity and mass, our player will also interact with other elements in the game. While the enemies in our game do not exactly “attack,” they will deal damage, which in turn will cause our character to react with a negative force. We will also have physics objects such as springs and platforms that our player will interact with. Their mass and physics properties will have an effect on how our player reacts when colliding with them. An example would be a sticky surface as opposed to a slick surface and how the player moves when walking across it.

As we move forward, we will go more into these rules of physics, but having this basic ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.