Make Them Fall

The Physics Engine

There’s a smart way to deal With object movements, which is to let the engine do the job for you! If your game idea fits With it, the physics engine will do a lot of the heavy lifting.

The physics engine adds life to your game objects by giving them weight and consistency, which allows objects to fall, bounce, and collide. Games like Angry Birds are great examples of the physics engine doing its job.

A Bouncing Ball in 6 Lines of Code

ifig0101.jpg

Type this code into your editor, run it, and look at how the ball is falling and bouncing, where your code is not doing anything!

Let me explain the code:

  • 1) We require ...

Get Create 2D Mobile Games with Corona SDK 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.