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
テンションも揚げてこう! Ebitengine開発
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
lapis2411
September 23, 2023
Technology
3.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
テンションも揚げてこう! Ebitengine開発
https://gocon.connpass.com/event/292391/
の登壇資料です。
lapis2411
September 23, 2023
More Decks by lapis2411
See All by lapis2411
イケてるボタンを考える
lapis2411
0
660
WASMで画像生成するためにデータを受け渡す
lapis2411
0
95
Other Decks in Technology
See All in Technology
Tab5をRubyで動くパソコンにする
kishima
2
280
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
2
470
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
120
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
1
490
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
940
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
290
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
150
2026-09-09 【sigma_ucj#1】Sigma を IaC 管理したい! / IaC for Sigma
civitaspo
0
110
AI時代だからこそ、スケールしないことをやろう
yutashigemura
1
130
SQL文一行も書けない人事がCortexもろもろを使って人事業務を楽にしてみる
ponponmikankan
1
210
プロダクト思考 × 基盤思考を AIで実現する Compound Engineering
tkc66buzz
1
310
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
460
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Documentation Writing (for coders)
carmenintech
77
5.5k
Building an army of robots
kneath
306
46k
Test your architecture with Archunit
thirion
2
2.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
A better future with KSS
kneath
240
18k
New Earth Scene 8
popppiees
3
2.5k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Amusing Abliteration
ianozsvald
1
290
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
How GitHub (no longer) Works
holman
316
150k
Transcript
テンションも揚げてこう! Ebitengine開発
自己紹介 藤原健(lapis2411) ・大学時代 - DXライブラリ(C++)を使ったゲーム開発 ・社会人 - 車載組込開発(3年) - 機械設計&検査ソフト開発(2年)
- ブラウザゲームバックエンド(1年) ・趣味 - ボードゲーム Splendor 1000戦 アルナックが好き Dice × Dice Politicsという ボドゲを製作
ゲーム開発してテンションが上がることといえば? イケてるイラスト? めちゃ面白い企画? いい音楽? 最高のチームメンバー?
ゲーム開発してテンションが上がることといえば? もちろんこれもテンション上がるけど ゲームパッド使えたらゲームしてる感がでて テンションが上がらないですか?
ゲーム開発してテンションが上がることといえば? それEbitenengineなら簡単にできます!
実装サンプル
コード実装の説明 func (g *GamepadInput) Update() { if inpututil.IsGamepadButtonJustPressed(0, ebiten.GamepadButton0) {
// Aボタンが押された時の処理 } if ebiten.IsGamepadButtonPressed(0, ebiten.GamepadButton1) { // Bボタンが押されている時の処理 } if inpututil.IsGamepadButtonJustPressed(0, ebiten.GamepadButton7) { //startボタン押下時の処理 } // 左コントロールスティックの入力量を取得 av := ebiten.GamepadAxisValue(0, 0) g.axisValue = 0 // デフォルトで微妙に倒れるので最小感度を設定 if av < -0.3 || av > 0.3 { // 最小感度以上スティックが倒れた時の処理 } } type GamepadInput struct { jump bool fastDrop bool axisValue float64 pause bool }
コード実装の説明 func IsGamepadButtonJustPressed(id ebiten.GamepadID, button ebiten.GamepadButton) bool func IsGamepadButtonJustReleased(id ebiten.GamepadID,
button ebiten.GamepadButton) bool ゲームパッドのボタン入力監視 IsGamepadButtonJustPressed → 現在のTickでボタンが押下されたかどうか IsGamepadButtonJustReleased → 現在のTickでボタンが解放されたかどうか ボタンの状態が変わった瞬間のみ動作させたい →メニューの決定、ジャンプ inpututil パッケージ
コード実装の説明 func IsGamepadButtonPressed(id GamepadID, button GamepadButton) bool ゲームパッドのボタン入力監視 IsGamepadButtonPressed →
現在ボタンが押下されたかどうか (その瞬間の状態がどうか) ボタンが押されている間(もしくは放されている間)動作させたい →ホバリング(ボタンが押されている間は少しずつ上昇、とか ) サンプルではBボタンが押されている間落下速度の上限が上がる ebiten パッケージ
コード実装の説明 func GamepadAxisValue(id GamepadID, axis int) float64 ゲームパッドのスティック入力監視 GamepadAxisValue →
スティックの倒し具合を-1.0~1.0の間で返す axis 0:左スティックX軸方向 1: 左スティックY軸方向 スティックの倒し具合に応じて何かしらの処理をしたい → 移動、メニューセレクト ebiten パッケージ
まとめ • Ebitengine では関数呼び出しで簡単にゲームパッド入力が受け取れる • 今回はサンプルで動けばいいやの実装なので、 ゲームパッドが複数入力された場合にどうするか、 抜き差しされた場合にどうするか、みたいな部分は別途考慮が必要 → 公式のサンプル見たほうが早い
https://ebitengine.org/ja/examples/gamepad.html • PCゲームとしてのリリースを考えるなら入力周りの設計は工夫が必要 • 一応今回のコードは以下で公開してます https://github.com/lapis2411/ebitengine-game
まとめ テンションも揚げ揚げでゲーム開発しよう!