Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| efefb3614b |
@@ -96,7 +96,6 @@ func BuildGrid(numRows int, numColumns int) {
|
||||
|
||||
//assign random colours to a subset of all squares
|
||||
squaresToColour := min(numColumns, numRows)
|
||||
|
||||
usedPositions := make([]Pair, squaresToColour)
|
||||
coloredSoFar := 0
|
||||
for i := 0; i < squaresToColour; i++ {
|
||||
|
||||
@@ -26,7 +26,7 @@ func (sm *ScoreManager) Draw(screen *ebiten.Image) {
|
||||
|
||||
//highScoreStr := fmt.Sprintf("High Score: %v", highScore)
|
||||
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)
|
||||
//stringWidth := font.MeasureString(face, highScoreStr).Ceil()
|
||||
@@ -38,8 +38,17 @@ func (sm *ScoreManager) Draw(screen *ebiten.Image) {
|
||||
|
||||
//draw energy at the top
|
||||
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()
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user