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
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
680
WASMで画像生成するためにデータを受け渡す
lapis2411
0
100
Other Decks in Technology
See All in Technology
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
200
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
150
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
310
Claude の新機能を、 出た日に触って社内に届けるまで
rfdnxbro
1
190
専門領域のAIをどう評価するか
bengo4com
2
260
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
AIカンパニーへの転換を支えた、エンジニアの仕事の再定義
kworkdev
PRO
2
1.3k
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
120
Local CI × GitHub Actions
gogutan
2
220
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
340
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
100
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Skip the Path - Find Your Career Trail
mkilby
1
260
Technical Leadership for Architectural Decision Making
baasie
3
600
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
Designing for Performance
lara
612
70k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Testing 201, or: Great Expectations
jmmastey
46
8.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Balancing Empowerment & Direction
lara
6
1.3k
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
まとめ テンションも揚げ揚げでゲーム開発しよう!