|
|
|
@@ -26,7 +26,7 @@ func (sm *ScoreManager) Draw(screen *ebiten.Image) {
|
|
|
|
|
|
|
|
|
|
|
|
//highScoreStr := fmt.Sprintf("High Score: %v", highScore)
|
|
|
|
//highScoreStr := fmt.Sprintf("High Score: %v", highScore)
|
|
|
|
levelStr := fmt.Sprintf("Level: %v", geom.CurrentLevel)
|
|
|
|
levelStr := fmt.Sprintf("Level: %v", geom.CurrentLevel)
|
|
|
|
face := assets.LoadFontFace("fonts/robot.otf", 12)
|
|
|
|
face := FaceA //assets.LoadFontFace("fonts/robot.otf", 12)
|
|
|
|
|
|
|
|
|
|
|
|
//draw high score (i.e. best level)
|
|
|
|
//draw high score (i.e. best level)
|
|
|
|
//stringWidth := font.MeasureString(face, highScoreStr).Ceil()
|
|
|
|
//stringWidth := font.MeasureString(face, highScoreStr).Ceil()
|
|
|
|
@@ -38,8 +38,17 @@ func (sm *ScoreManager) Draw(screen *ebiten.Image) {
|
|
|
|
|
|
|
|
|
|
|
|
//draw energy at the top
|
|
|
|
//draw energy at the top
|
|
|
|
energyStr := fmt.Sprintf("Energy: %v", geom.CurrentEnergy)
|
|
|
|
energyStr := fmt.Sprintf("Energy: %v", geom.CurrentEnergy)
|
|
|
|
face = assets.LoadFontFace("fonts/robot.otf", 20)
|
|
|
|
face = FaceB // assets.LoadFontFace("fonts/robot.otf", 20)
|
|
|
|
stringWidth := font.MeasureString(face, energyStr).Ceil()
|
|
|
|
stringWidth := font.MeasureString(face, energyStr).Ceil()
|
|
|
|
text.Draw(screen, energyStr, face, w/2-stringWidth/2, geom.ScoreOffset, color.White)
|
|
|
|
text.Draw(screen, energyStr, face, w/2-stringWidth/2, geom.ScoreOffset, color.White)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
FaceA, FaceB font.Face
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
|
|
FaceA = assets.LoadFontFace("fonts/robot.otf", 12)
|
|
|
|
|
|
|
|
FaceB = assets.LoadFontFace("fonts/robot.otf", 20)
|
|
|
|
|
|
|
|
}
|
|
|
|
|