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.3k
20210219 Flutterに入門してみた
itok
1
3.9k
20201009 iOS 14 ウィジェットをつくってみた
itok
1
2.3k
20191206 Property Wrappers 入門
itok
0
1.6k
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
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
850
Create a website using Spatial Web
akkeylab
0
300
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.3k
関数型まつりレポート for JuliaTokai #22
antimon2
0
150
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.4k
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
130
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
46
31k
A2A プロトコルを試してみる
azukiazusa1
2
1.1k
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
120
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
190
エラーって何種類あるの?
kajitack
5
310
Featured
See All Featured
Navigating Team Friction
lara
187
15k
Balancing Empowerment & Direction
lara
1
370
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Site-Speed That Sticks
csswizardry
10
660
Unsuck your backbone
ammeep
671
58k
Gamification - CAS2011
davidbonilla
81
5.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Typedesign – Prime Four
hannesfritz
42
2.7k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
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୯ମͰޮՌԻ͕໐Βͤͳ͍