Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
最強の放置ゲームを作ってる話 ~ と、そのうちのゲーム作るためのゲームデータエディタを作ってる話 ~
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kthatoto
February 25, 2021
Programming
79
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
最強の放置ゲームを作ってる話 ~ と、そのうちのゲーム作るためのゲームデータエディタを作ってる話 ~
kthatoto
February 25, 2021
More Decks by kthatoto
See All by kthatoto
複数ブラウザウィンドウを 単一平面とみなしてボールの 衝突判定をする
kthatoto
0
220
CSSだけでCookie Clickerを作る
kthatoto
0
1.1k
いろいろな駆動開発の話 / various-driven-development
kthatoto
0
100
ぼくのかんがえたさいきょうの放置ゲームを作ってる話 / saikyou-houti-game
kthatoto
1
490
ぼくのかんがえたさいきょうのぶろぐしすてむ
kthatoto
0
750
Other Decks in Programming
See All in Programming
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
110
最近”作らせてる” ローカルAIアプリの話
akit37
0
490
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
110
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.2k
パスワード再設定メールのURLについて知っておこう
uyuki234
0
180
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
200
ChromeでローカルLLM
ryu1013
0
160
Railsバージョンを4倍にした話
optim
0
580
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
contenteditable と日本語入力に向き合う
colorful12
0
210
golang-bob.pdf
iwatsukayura
0
140
Featured
See All Featured
Practical Orchestrator
shlominoach
192
12k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Code Reviewing Like a Champion
maltzj
529
40k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Git: the NoSQL Database
bkeepers
PRO
433
67k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
760
Transcript
࠷ڧͷ์ஔήʔϜΛ࡞ͬͯΔ ~ ͱɺͦͷ͏ͪͷήʔϜ࡞ΔͨΊͷήʔϜσʔλΤσΟλΛ࡞ͬͯΔ ~ by @kthatoto at ΞϧϛLTձ#4 on 2021/02/25()
21:00~
ࣗݾհ • ϋϯυϧωʔϜɿͱ (kthatoto) • Ruby/Rails, JavaScript/TypeScript, Nuxt/Vue, Go •
Twitterɿhttps://twitter.com/kthatoto • GitHubɿhttps://github.com/kthatoto
࠷ڧͷ์ஔήʔϜ ~ಈػ~ • 100%ࣗΈͷ์ஔήʔϜ͕͍ͨ͠ • ࣗͰ࡞Δ͔͠ͳ͍ • Ұൠతͳ์ஔήʔϜ์ஔใुྔ͕1࣍తɺ ͍͍ͤͥ2࣍త •
͡Ό͋Ծʹ3࣍తҎ্ͷใु͕Β͑ͨͱͯ͠ɺࣗͰ ୡͨ͠ײ͕͋·Γͳ͍
ԣಓ - ์ஔήʔϜͷ์ஔใु 1࣍త 1࣌ؒ͋ͨΓ10Goldੜ͞ΕΔήʔϜΛ24࣌ؒ์ஔ = 240Gold 10 × 24
2࣍త 1࣌ؒ͋ͨΓ(10 + x)Goldੜɺxͷॳظ0 xͷ1࣌ؒ͋ͨΓ+1͞ΕΔήʔϜΛ24࣌ؒ์ஔ = 516Gold 10 × 24 + 24 × (24 − 1) 2 ɾɾɾ ɾɾɾ
ԣಓ - ์ஔήʔϜͷ์ஔใु 3࣍త 1࣌ؒ͋ͨΓ(10 + x)Goldੜɺxͷॳظ0 xͷ1࣌ؒ͋ͨΓ+y͞ΕΔɺyͷॳظ0 yͷ1࣌ؒ͋ͨΓ+1͞ΕΔήʔϜΛ24࣌ؒ์ஔ =
2540Gold 10 × 24 + 24 × (242 − 1) 6 ɾɾɾ ͷʹΑͬͯୡײͷͳ͍ ΠϯϑϨͷΑ͏ʹײͯ͡͠·͏
ଟ࣍ݩతͳΠϯϑϨΛࣗͷ ૢ࡞ʹΑͬͯ֫ಘ͢Ε ୡײ͕ຯΘ͑Δ ์ஔ͍ͨ͠ʂ VS ࠷ڧͷ์ஔήʔϜ ~ಈػ~
์ஔ͞Ε͍ͯΔ࣌ͷήʔϜͷৼΔ͍Λ ࣗͰϓϩάϥϜͰ͖ΔΑ͏ʹ͢Ε ͍͍Μ͡ΌͶʁ🤔
ଟ࣍ݩతͳΠϯϑϨΛࣗͷ ૢ࡞ʹΑͬͯ֫ಘ͢Ε ୡײ͕ຯΘ͑Δ ์ஔ͍ͨ͠ʂ 🤝 ࠷ڧͷ์ஔήʔϜ ~ಈػ~ ϓϩάϥϜΛॻ͍ͯ ์ஔ࣌ͷৼΔ͍ΛࣗͰ ܾఆ͢Δ
ॻ͍ͨϓϩάϥϜΛΒͤͯ ์ஔ͢Δ
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ $ game keyup $ game keyleft $ game
keydown $ game keyright $ game action $ game cancel γΣϧͱͯ͠ΞΫηεͰ͖ΔΑ͏ʹ͢Ε ΄ͱΜͲͷϓϩάϥϜݴޠ͔ΒΞΫηεՄೳ
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ ήʔϜαʔόʔ ήʔϜ σʔλ αʔόʔ ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε Websocket
Connection $ game keyup $ game action $ game keydown ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε $ game keyleft $ game keyleft $ game action RPC RPC
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ ήʔϜαʔόʔ ήʔϜ σʔλ αʔόʔ ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε Websocket
Connection $ game keyup $ game action $ game keydown RPC ϒϥβ ෳͷΩϟϥΫλʔΛಉ࣌ʹ ૢ࡞͢Δ͜ͱͰ͖Δ
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ ήʔϜαʔόʔ ήʔϜ σʔλ αʔόʔ ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε Websocket
Connection $ game keyup $ game action $ game keydown RPC ϒϥβ ήʔϜαʔόʔ ήʔϜͷ৺ଁɻΫϥΠΞϯτͱͷଓཧɺ ήʔϜϩδοΫॲཧɺΫϥΠΞϯτ͔Βͷཁ ٻʹର͢Δσʔλฦ٫ͳͲΛߦ͏ɻ IUUQTHJUIVCDPNLUIBUPUPUFSNXPSMETFSWFS
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ ήʔϜαʔόʔ ήʔϜ σʔλ αʔόʔ ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε Websocket
Connection $ game keyup $ game action $ game keydown RPC ϒϥβ $-*ΫϥΠΞϯτ ϫʔΧʔϓϩηεΛىಈͯ͠ίωΫγϣϯΛ ுΓɺͦΕΛ௨ͯ͠શͯͷૢ࡞Λ࣮ߦ͢Δ͜ ͱ͕Ͱ͖ΔɻϓϩάϥϜΛॻ͍ͯࣗಈԽ͢Δ ͱ͖͜ΕΛ͏ɻ IUUQTHJUIVCDPNLUIBUPUPUFSNXPSME
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ ήʔϜαʔόʔ ήʔϜ σʔλ αʔόʔ ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε Websocket
Connection $ game keyup $ game action $ game keydown RPC ϒϥβ ϒϥβΫϥΠΞϯτ ී௨ʹήʔϜΛϓϨΠ͢Δ͜ͱ͕Ͱ͖Δɻ ະணख
࠷ڧͷ์ஔήʔϜ ~֓ཁ~ ήʔϜαʔόʔ ήʔϜ σʔλ αʔόʔ ϓϨΠϠʔͷPC ϫʔΧʔ ϓϩηε Websocket
Connection $ game keyup $ game action $ game keydown RPC ϒϥβ ήʔϜσʔλΤσΟλʔ Ϛελʔσʔλͷ࡞ɺཧΛߦ͏ɻ 31(πΫʔϧΈ͍ͨͳͷɻࠓͷओɻ IUUQTHJUIVCDPNLUIBUPUPUXHBNFFEJUPS
ήʔϜσʔλΤσΟλʔʹ͍͍ͭͯͨ͜͠ͱ • ϑΝΠϧγεςϜΛNuxtͷΈͰૢ࡞͢Δ • Canvas Infinite Scroll ͷΈ • ΦʔϓϯϫʔϧυͷϚοϓσʔλϑΝΠϧͷׂΛಠࣗ
࣮ͯ͠Έͨ (Coming Soon)
ϑΝΠϧγεςϜΛNuxtͷΈͰૢ࡞͢Δ • ϚοϓσʔλϑΝΠϧΛϑϩϯτΤϯυͷΈͰ ฤू͍ͨ͠ • ϚοϓσʔλϑΝΠϧ͚ͩͰɺΦʔϓϯϫʔϧυʹ ͍͔ͨ͠ΒෳϑΝΠϧʹׂ͢Δ͜ͱʹͳΔ • ϚοϓλΠϧͷը૾σʔλͳͲѻ͍͍ͨ ϑΝΠϧΛҰׅಡΈࠐΈ͢Δඞཁ͕͋Δ
nodeͷ Λ͍͍ͨ fs ͰϑΝΠϧॲཧAPIαʔόʔผͰ࡞ΔͷΊΜͲ͍...
Nuxt ͷ Server Middleware ͬͯΈΔ🤔
Nuxt Server Middleware ͱ • NuxtʹAPIαʔόʔతͳ͜ͱ୲ΘͤΔ • on node Ͱॻ͚Δ
fs ͕͑Δʂʂʂʂʂʂʂ fs.mkdir // create directory fs.rmdir // remove directory fs.readdir // list files fs.writeFile // write file fs.readFile // read file fs.unlink // delete file fs.rename // move file/directory
ϑΝΠϧγεςϜΛNuxtͷΈͰૢ࡞͢Δ Nuxt Server Frontend GET /images fs.readdir fs.readFile for {
} Response List Images
const container = document. getElementById('container') container.addEventListener('scroll', () => { const
x = container.value.scrollLeft - 25 const y = container.value.scrollTop - 25 const canvas = getElementById('canvas') canvas.style.transform = `translate(${x}px, ${y}px)` }) Canvas (Infinite) Scroll ͷΈ <div id="container"> <div class="large-box"> <canvas id="canvas"/> </div> </div> #container { width: 300px; height: 300px; overflow: scroll; } .large-box { width: 5000px; height: 5000px; } canvas { width: 350px; height: 350px; }
Canvas (Infinite) Scroll ͷΈ σϞ on Keynote <div id="container"> <div
class="large-box"> <canvas id="canvas"/> </div> </div> https://konvajs.org/docs/sandbox/Canvas_Scrolling.html
• ࣮εΫϩʔϧҐஔ࠲ඪͱ ԾεΫϩʔϧҐஔ࠲ඪΛ͓࣋ͬͯ͘ • εΫϩʔϧʹΑΔ࣮εΫϩʔϧҐஔ࠲ඪͷࠩΛ ԾεΫϩʔϧҐஔ࠲ඪʹͯΔ • ࣮εΫϩʔϧҐஔ࠲ඪ͕ͬ͜ʹ͖ͨΒɺ ࣮εΫϩʔϧҐஔ࠲ඪΛਅΜதʹͯ͠ ԾεΫϩʔϧҐஔ࠲ඪมԽͤ͞ͳ͍
• ඳըΛԾεΫϩʔϧҐஔ࠲ඪΛͱʹߦ͑ ແݶεΫϩʔϧͷ Canvas Infinite Scroll ͷΈ