This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) step:(ccTime)elapsedTime | |
{ | |
// Fix the time elapsed to avoid the spiral of death | |
if (elapsedTime > 0.2) | |
elapsedTime = 0.2 | |
// Do physics time-stepping. | |
_dtAccumulator += elapsedTime; | |
while (_dtAccumulator >= _dt) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) step:(ccTime)elapsedTime | |
{ | |
// Do physics time-stepping. | |
_dtAccumulator += elapsedTime; | |
while (_dtAccumulator >= _dt) { | |
// Take the actual physics step with step-size _dt | |
cpSpaceStep(_space, _dt); | |
_dtAccumulator -= _dt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fibs :: [Integer] | |
fibs = 1 : 1 : zipWith myadd fibs (tail fibs) | |
where myadd x y = trace (" Adding: " ++ show x ++ " & " ++ show y ++ "\n") | |
(x+y) |