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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
570
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
Optunaの最新リリースv5.0について
pfn
PRO
0
120
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
330
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
340
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
120
継続的なAIコスト最適化
bgpat
1
340
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
380
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
4.9k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Navigating Weather and Climate Data
rabernat
0
560
How to Ace a Technical Interview
jacobian
280
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
How STYLIGHT went responsive
nonsquared
100
6.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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
まとめ テンションも揚げ揚げでゲーム開発しよう!