-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from pankona/ready-button-in-menu
ready button in menu
- Loading branch information
Showing
7 changed files
with
139 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/hajimehoshi/ebiten/v2" | ||
"github.com/hajimehoshi/ebiten/v2/ebitenutil" | ||
) | ||
|
||
type instruction struct { | ||
game *Game | ||
|
||
erapsedFrame int | ||
zindex int | ||
|
||
x, y int | ||
text string | ||
} | ||
|
||
func newInstruction(game *Game, text string, x, y int) *instruction { | ||
return &instruction{ | ||
game: game, | ||
|
||
x: x, | ||
y: y, | ||
text: text, | ||
|
||
zindex: 100, | ||
} | ||
} | ||
|
||
func (i *instruction) Draw(screen *ebiten.Image) { | ||
// click me to open build menu と、家の下 (画面中央下) に表示する | ||
// 点滅させる | ||
i.erapsedFrame++ | ||
if i.erapsedFrame%240 < 120 { | ||
ebitenutil.DebugPrintAt(screen, i.text, i.x, i.y) | ||
} | ||
} | ||
|
||
func (i *instruction) ZIndex() int { | ||
return i.zindex | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters