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
テンションも揚げてこう! 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
640
WASMで画像生成するためにデータを受け渡す
lapis2411
0
93
Other Decks in Technology
See All in Technology
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
740
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
230
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
3
790
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
180
AI時代におけるエンジニアの新たな役割──FDEとクオリアの探求/登壇資料(戸井田 裕貴)
hacobu
PRO
0
330
Multicaで30個のミニプロジェクトをAIエージェント運用して見えてきたこと
eiei114
1
630
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
1.1k
発表と総括 / Presentations and Summary
ks91
PRO
0
190
なぜ、あなたのエージェントは言うことを聞かないのか
segavvy
1
380
【公開用】AI_Dev_Ex2026_AI_登壇資料
matsuritechnologies
PRO
2
490
VPCセキュリティ対応の最新事情
nagisa53
1
290
Type-safe IaC for Dart
coborinai
0
180
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
380
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
240
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
WENDY [Excerpt]
tessaabrams
11
38k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
510
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
260
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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
まとめ テンションも揚げ揚げでゲーム開発しよう!