Building Paddles with Bodies, Pins, and Torque
Let’s face it: we can’t call this a pinball game without paddles. It’s the player’s sole point of control in the game (after launching the ball, of course), and we want to make it feel just right. We want paddles that appear to have weight as they snap up when triggered and fall back in place when let go. Let’s think through the way a paddle is designed and see what we can use from the Sprite Kit physics toolbox to implement it.
In essence, a paddle is a bar attached to an anchor, forming a pin joint that allows it to spin around, yet it’s limited in range of motion. The paddle rests at a certain angle until flipped by an angular force, causing the box to swivel around the pin to its maximum angle, ...
Get Build iOS Games with Sprite Kit 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.