Book Image

HTML5 Game Development by Example: Beginner's Guide

By : Seng Hin Mak
Book Image

HTML5 Game Development by Example: Beginner's Guide

By: Seng Hin Mak

Overview of this book

Table of Contents (18 chapters)
HTML5 Game Development by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
9
Building a Physics Car Game with Box2D and Canvas
Index

Advancing the world time


The box is dynamic but it does not fall down. Are we doing anything wrong here? The answer is no. We have set up the box correctly, but we forget to advance the time in the physics world.

In the Box2D physics world, all calculations are done in a systematic iteration. The world calculates the physical transformation of all things according to the current step. When we move the step to the next level, the world calculates again as the new state.