This file contains hidden or 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
func getUptime() -> Int { | |
let nanoseconds = DispatchTime.now() | |
return Int(nanoseconds.rawValue / 1000000000) | |
} |
This file contains hidden or 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
// | |
// StoryboardExtensionsBeta4Fix.swift | |
// | |
// A workaround so that you can use SplitView | |
// and TabView items in OS X Storyboards on | |
// 10.10. Just drop this in your Swift project. | |
// | |
// Hopefully the need for this goes away in soon | |
// as it used to work. |
This file contains hidden or 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
// Speed limiter | |
- (void)shipSpeedLimit { | |
// Check the x velocity | |
if (self.ship.physicsBody.velocity.dx > 500) { | |
self.ship.physicsBody.velocity = CGVectorMake(500, self.ship.physicsBody.velocity.dy); | |
} else if (self.ship.physicsBody.velocity.dx < -500) { | |
self.ship.physicsBody.velocity = CGVectorMake(-500, self.ship.physicsBody.velocity.dy); | |
} | |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
#define ARC4RANDOM_MAX 0x100000000 | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
long double hit = 0; |
NewerOlder