4 ms·
I only heard about Flappy Bird today because of the personal story around why it was taken down. However, this seems like just a remake of the helicopter game
by okamiueru 13y ago
I only heard about Flappy Bird today because of the personal story around why it was taken down.
However, this seems like just a remake of the helicopter game, which is fair enough, but hardly a feat of engineering. So, if this is the case, then what is this about using a "physics engine"? Determining if rectangles intersect seems a bit too trivial to me to be of interest, and I'm just confused what it is doing here.
- joeblau 13y agoIn iOS7, Apple introduced a new physics engine called UIDynamics. It's built natively into the OS which allows you to give any UIView on the screen physical properties such as Snap, Gravity, Collision, Attachments, and Pushing. Those properties, in turn, have settings like friction, density, gravitational pull, damping, elasticity, etc... The idea behind it was to make it so that you could create game style physics mechanics in any iOS application. One example is the iOS7 notification center; If you drag it down and "slam" it to the bottom of the screen, it has some bounce. A second example is the Messages chats when scrolling quickly; You'll notice that as the swipe seed increases you get more space between peoples chat comments and they kind of slam together when you stop scrolling. What I aimed to do here is take that same engine and use it to build FlappyBlock. So instead of having a loop that says: while () { // Pipe is not on the left movePipeOnePixelLeft(); // Move Pipe one pixel over if (at the left) break; // If we hit the left, end loop } Physics would say something like this: givePipeMassAndLocation(); // Give Pipe physical properties pushPipeLeftWithForceVector(); // Push pipe to left with force whenPipeHitsLeftWallRemove(); // Remove the pipe when it his the left It's a different way of attacking the same problem using features many newer developers are not familiar with in iOS7.