Skip to content

Instantly share code, notes, and snippets.

View densmoe's full-sized avatar

Dennis Möller densmoe

View GitHub Profile
04c57ca363abe68b69ba7b1c2bd93e175e169c12ebb7c96ddf21edddc05a1f593b81cabed0eff1bfda3368c4c63fb84e6bde8a4f3e7176b710818120f666dfcd92
//: Playground - noun: a place where people can play
// Stackoverflow: http://stackoverflow.com/questions/39735667/how-to-find-the-intersection-point-of-rect-and-a-line-starting-in-its-center
import SpriteKit
import PlaygroundSupport
let pi = CGFloat(M_PI)
let angle = pi / 4 - 0.2
let rect = CGRect(x: 0, y: 0, width: 150, height: 150)
@densmoe
densmoe / file.swift
Last active July 16, 2016 16:18
DictionaryConvertible
protocol DictionaryConvertible {
init?(dict:[String:AnyObject])
var dict:[String:AnyObject] { get }
}
@densmoe
densmoe / GameScene.swift
Last active January 23, 2017 04:45
[Swift/SpriteKit] Game demo with multiple touch panning gestures
//http://stackoverflow.com/questions/31928324/how-to-drag-a-skspritenode-without-touching-it-with-swift/31930669?noredirect=1#comment51852474_31930669
import SpriteKit
class GameScene: SKScene {
var leftShape:ConfinedShape!
var rightShape:ConfinedShape!
override func didMoveToView(view: SKView) {