Skip to content

Commit f9ba699

Browse files
committed
fixed::
1 parent f45c75a commit f9ba699

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ smoketest: FORCE
1212
tinygo build -o ./out/all.gopher-board-i2c.uf2 --size short --target ./targets/gopher-board-i2c.json ./games/all/
1313
tinygo build -o ./out/all.gopher-board-spi.uf2 --size short --target ./targets/gopher-board-spi.json ./games/all/
1414
tinygo build -o ./out/all.wasm --size short --target wasm --no-debug --panic trap ./games/all/
15-
tinygo build -o ./out/goradius.zero-kb02.uf2 --size short --target ./targets/zero-kb02.json ./games/goradius/
15+
tinygo build -o ./out/goradius.zero-kb02.uf2 --size short --target ./targets/zero-kb02.json ./games/goradius/
1616

1717
FORCE:

games/goradius/goradius/game.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (g *Game) Update() error {
7777
dy := 1 * speed
7878

7979
// スタート画面からゲームプレイ画面に遷移
80-
if koebiten.IsKeyPressed(koebiten.KeyRotaryButton) {
80+
if koebiten.IsKeyPressed(koebiten.Key0) {
8181
g.gameState = gameStatePlaying
8282
}
8383

@@ -120,14 +120,6 @@ func (g *Game) Update() error {
120120
}
121121
}
122122

123-
// key0を押すとデバッグ情報を表示する
124-
if koebiten.IsKeyPressed(koebiten.Key0) {
125-
koebiten.Println("Goradius")
126-
koebiten.Println("x:", g.x, "y:", g.y)
127-
koebiten.Println("beam:", g.beamEnergy)
128-
koebiten.Println("Score:", g.score)
129-
}
130-
131123
// ビームを発射する
132124
if g.beamCooldownTimer > 0 {
133125
// クールダウン中はタイマーを減らす
@@ -180,14 +172,12 @@ func (g *Game) drawEnemy(e *enemy) {
180172
func (g *Game) drawTitle() {
181173
// タイトル画面を描画する
182174
koebiten.Println("Goradius")
183-
koebiten.Println("Press any key to start")
175+
koebiten.Println("Press key to start")
184176
}
185177

186178
func (g *Game) drawGameOver() {
187179
// ゲームオーバー画面を描画する
188180
koebiten.Println("Game Over")
189-
koebiten.Println("Score:", g.score)
190-
koebiten.Println("Press any key to restart")
191181
}
192182

193183
func (g *Game) drawGame(screen *koebiten.Image) {
@@ -199,6 +189,10 @@ func (g *Game) drawGame(screen *koebiten.Image) {
199189
op.GeoM.Translate(float32(g.x), float32(g.y))
200190
g.gopher.DrawImage(screen, op)
201191

192+
// スコアとエネルギー表示する
193+
koebiten.Println("beam:", g.beamEnergy)
194+
koebiten.Println("Score:", g.score)
195+
202196
// 一定間隔で敵を追加
203197
frames++
204198
if rand.N(interval) < 3 {

0 commit comments

Comments
 (0)