O'Reilly logo

Learn Game Programming with Ruby by Mark Sobkowicz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Add Moving Platforms

Moving platforms make your game more interesting and challenging. They require the player to think ahead and try to predict where the platforms will be when Chip reaches them. Some of the platforms will move side to side, and some will move up and down.

Adding moving platforms to your physics game requires a little creativity. Platforms that move like these don’t really occur in nature. You could just move them yourself by changing their position, but the result wouldn’t be good. They wouldn’t interact correctly with the player and the boulders. Instead, place them in the space and figure out what forces are needed to hold them up and move them back and forth. Then, you cheat the physics engine just a little to keep them ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required