Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20160928 時計仕掛けのアヒル
Search
Kei Ito
September 28, 2016
Programming
0
1k
20160928 時計仕掛けのアヒル
関モバ #18 の資料です
Kei Ito
September 28, 2016
Tweet
Share
More Decks by Kei Ito
See All by Kei Ito
20211015 Mac CatalystでmacOS用アプリを作る
itok
2
4.1k
20210219 Flutterに入門してみた
itok
1
3.9k
20201009 iOS 14 ウィジェットをつくってみた
itok
1
2.3k
20191206 Property Wrappers 入門
itok
0
1.5k
20190920 iOS 13 対応ではまった話
itok
1
2.3k
20190726 Background App Refresh Taskがやってきた
itok
0
2.1k
20190722 Firebase Remote Configでアドネットワークを管理する
itok
0
1.5k
20190419 iOSアプリで証明書の情報を参照する
itok
0
1.4k
20190412 Android TV向けアプリを作ってみる
itok
0
1k
Other Decks in Programming
See All in Programming
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
500
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
160
SwiftUI Viewの責務分離
elmetal
PRO
2
280
Kotlinの開発でも AIをいい感じに使いたい / Making the Most of AI in Kotlin Development
kohii00
5
1.7k
生成AIで加速するテスト実装 - ロリポップ for Gamersの事例と 生成AIエディタの活用
kinosuke01
0
140
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
250
技術を改善し続ける
gumioji
0
180
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
180
TCAを用いたAmebaのリアーキテクチャ
dazy
0
220
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
230
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
Ça bouge du côté des animations CSS !
goetter
2
160
Featured
See All Featured
BBQ
matthewcrist
87
9.5k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Building Your Own Lightsaber
phodgson
104
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
The Language of Interfaces
destraynor
156
24k
Practical Orchestrator
shlominoach
186
10k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
The Cult of Friendly URLs
andyhume
78
6.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Transcript
࣌ܭֻ͚ͷΞώϧ ؔϞόΠϧΞϓϦݚڀձ !JUPL@UXJU
!JUPL@UXJU w ͍ͱ͏͚͍ʢJUPLʣ w ɹɹɹɹɹɹͷதͷਓ w ެࢲڞʹϓϩάϥϚJ04.BDʢͨ·ʹ"OESPJE8JOEPXTʣ w IUUQJUPLKQ IUUQTPSBLB[FDPKQ
None
4NBSU5VCW
XBUDI04ରԠʂ
None
Ξώϧͷಈ͔͠ํ w 4QSJUF,JU w $PSF.PUJPO w 8,(FTUVSF3FDPHOJ[FS
4QSJUF,JU
४උ let scene = SKScene(size: size) scene.physicsWorld.gravity = CGVector(dx: 0,
dy: 0) self.sceneInterface.presentScene(scene)
෩࿊Գ let bath = SKSpriteNode(imageNamed: "xxx") bath.physicsBody = SKPhysicsBody(edgeLoopFrom: path)
scene.addChild(bath)
Ξώϧ let duck = SKSpriteNode(texture: tex, size: size) duck.physicsBody =
SKPhysicsBody(texture: tex, alphaThreshold: 0.2, size: size) bath.addChild(duck)
$PSF.PUJPO
४උ motionMgr.startAccelerometerUpdates(to: OperationQueue()) { (data, error) in if let data
= data { let acceleration = data.acceleration . . . } }
γΣΠΫ if self.isShake(acceleration) { self.addDuck() }
͖ var sign = 1 if WKInterfaceDevice.current().crownOrientation == .left {
sign = -1 } physicsWorld.gravity = CGVector(dx: x * sign, dy: y * sign)
8,(FTUVSF3FDPHOJ[FS
͘͡ @IBAction func handlePan(_ sender: AnyObject) { let pan =
sender as! WKPanGestureRecognizer let velocity = pan.velocityInObject() duck.physicsBody?.velocity = CGVector(dx: velocity.x * r, dy: -velocity.y * r) }
·ͱΊ w ͚ͯΔͱ͙͢ʹը໘͕εϦʔϓ͢Δ w Ϋϥϯͷ͖ʹҙ w (FTUVSF3FDPHOJ[FS*#ͰͷΈଓͰ͖Δ w XBUDI୯ମͰޮՌԻ͕໐Βͤͳ͍