mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Compare commits
6 Commits
d4dfb88f3f
...
6bf9ab8b6a
Author | SHA1 | Date | |
---|---|---|---|
|
6bf9ab8b6a | ||
|
b7015c4354 | ||
|
96984210e1 | ||
|
1cd6a1f10c | ||
|
0eb2b9980d | ||
|
76a170eecf |
6
.github/workflows/pages.yml
vendored
6
.github/workflows/pages.yml
vendored
@ -21,14 +21,14 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v3
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Build with Jekyll
|
||||
uses: actions/jekyll-build-pages@v1
|
||||
with:
|
||||
source: ./.github/workflows/site
|
||||
destination: ./_site
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
@ -39,4 +39,4 @@ jobs:
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
uses: actions/deploy-pages@v4
|
||||
|
2
.github/workflows/steam.yml
vendored
2
.github/workflows/steam.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker build (amd64)
|
||||
run: |
|
||||
|
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -23,15 +23,15 @@ jobs:
|
||||
git config --global core.eol lf
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
4
.github/workflows/vuln.yml
vendored
4
.github/workflows/vuln.yml
vendored
@ -39,10 +39,10 @@ jobs:
|
||||
git config --global core.eol lf
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
|
@ -22,6 +22,9 @@ var (
|
||||
//go:embed jab.wav
|
||||
Jab_wav []byte
|
||||
|
||||
//go:embed jab8.wav
|
||||
Jab8_wav []byte
|
||||
|
||||
//go:embed jump.ogg
|
||||
Jump_ogg []byte
|
||||
|
||||
|
BIN
examples/resources/audio/jab8.wav
Normal file
BIN
examples/resources/audio/jab8.wav
Normal file
Binary file not shown.
@ -10,17 +10,18 @@ http://www.sozai-page.com/02_sozai/b/b04/b04_002/b04_002.html
|
||||
|
||||
```
|
||||
The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
|
||||
The design is licensed under the Creative Commons 3.0 Attributions license.
|
||||
The design is licensed under the Creative Commons 4.0 Attributions license.
|
||||
Read this article for more details: https://blog.golang.org/gopher
|
||||
```
|
||||
|
||||
## gophers.jpg
|
||||
|
||||
```
|
||||
http://blog.golang.org/go-programming-language-turns-two
|
||||
https://go.dev/blog/2years
|
||||
https://go.dev/copyright
|
||||
|
||||
Photograph by Chris Nokleberg
|
||||
the Creative Commons Attribution 3.0 License
|
||||
The Creative Commons Attribution 4.0 License
|
||||
```
|
||||
|
||||
## runner.png
|
||||
@ -175,5 +176,5 @@ MIT License
|
||||
|
||||
```
|
||||
Copyright 2014 Hajime Hoshi
|
||||
the Creative Commons Attribution 3.0 License
|
||||
The Creative Commons Attribution 4.0 License
|
||||
```
|
||||
|
@ -16,6 +16,8 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
@ -32,6 +34,10 @@ const (
|
||||
sampleRate = 48000
|
||||
)
|
||||
|
||||
var (
|
||||
flagBitsPerSample = flag.Int("bits", 16, "bits per sample")
|
||||
)
|
||||
|
||||
type Game struct {
|
||||
audioContext *audio.Context
|
||||
audioPlayer *audio.Player
|
||||
@ -59,7 +65,14 @@ func NewGame() (*Game, error) {
|
||||
// ...
|
||||
|
||||
// Decode wav-formatted data and retrieve decoded PCM stream.
|
||||
d, err := wav.DecodeWithoutResampling(bytes.NewReader(raudio.Jab_wav))
|
||||
var r io.Reader
|
||||
switch *flagBitsPerSample {
|
||||
case 8:
|
||||
r = bytes.NewReader(raudio.Jab8_wav)
|
||||
default:
|
||||
r = bytes.NewReader(raudio.Jab_wav)
|
||||
}
|
||||
d, err := wav.DecodeWithoutResampling(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -99,6 +112,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
g, err := NewGame()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ require (
|
||||
github.com/ebitengine/gomobile v0.0.0-20240518074828-e86332849895
|
||||
github.com/ebitengine/hideconsole v1.0.0
|
||||
github.com/ebitengine/oto/v3 v3.3.0-alpha.1
|
||||
github.com/ebitengine/purego v0.8.0-alpha.2
|
||||
github.com/ebitengine/purego v0.8.0-alpha.2.0.20240620120633-4c3273e2bc2e
|
||||
github.com/gen2brain/mpeg v0.3.2-0.20240412154320-a2ac4fc8a46f
|
||||
github.com/go-text/typesetting v0.1.1
|
||||
github.com/hajimehoshi/bitmapfont/v3 v3.2.0-alpha.2
|
||||
|
4
go.sum
4
go.sum
@ -4,8 +4,8 @@ github.com/ebitengine/hideconsole v1.0.0 h1:5J4U0kXF+pv/DhiXt5/lTz0eO5ogJ1iXb8Yj
|
||||
github.com/ebitengine/hideconsole v1.0.0/go.mod h1:hTTBTvVYWKBuxPr7peweneWdkUwEuHuB3C1R/ielR1A=
|
||||
github.com/ebitengine/oto/v3 v3.3.0-alpha.1 h1:J2nBmQwPLKc4+yLObytq1jKNydI96l6EjZfgefiqGbk=
|
||||
github.com/ebitengine/oto/v3 v3.3.0-alpha.1/go.mod h1:T2/VV0UWG97GEEf4kORMU2nCneYT/YmwSTxPutSVaUg=
|
||||
github.com/ebitengine/purego v0.8.0-alpha.2 h1:+Kyr9n4eXAGMzhtWJxfdQ7AzGn0+6ZWihfCCxul3Dso=
|
||||
github.com/ebitengine/purego v0.8.0-alpha.2/go.mod h1:w5fARo4H5UrAgQTz0yqDfZ6bjstTQwUFmO+TN+nHlWE=
|
||||
github.com/ebitengine/purego v0.8.0-alpha.2.0.20240620120633-4c3273e2bc2e h1:Do0Ag7xIjxmXpZ0dSBt56bg/POw5wOjevFndam1L2cQ=
|
||||
github.com/ebitengine/purego v0.8.0-alpha.2.0.20240620120633-4c3273e2bc2e/go.mod h1:cJsFmQCiLTx+cpFhVN3pj+pQfpYnn2OLeJtaKsRmVoA=
|
||||
github.com/gen2brain/mpeg v0.3.2-0.20240412154320-a2ac4fc8a46f h1:ysqRe+lvUiL0dH5XzkH0Bz68bFMPJ4f5Si4L/HD9SGk=
|
||||
github.com/gen2brain/mpeg v0.3.2-0.20240412154320-a2ac4fc8a46f/go.mod h1:i/ebyRRv/IoHixuZ9bElZnXbmfoUVPGQpdsJ4sVuX38=
|
||||
github.com/go-text/typesetting v0.1.1 h1:bGAesCuo85nXnEN5LmFMVGAGpGkCPtHrZLi//qD7EJo=
|
||||
|
Loading…
Reference in New Issue
Block a user