examples: Remove unneeded error checks

This commit is contained in:
Hajime Hoshi 2017-06-03 00:51:15 +09:00
parent 2680884566
commit 9a4a7fe5ba
2 changed files with 6 additions and 23 deletions

View File

@ -285,14 +285,8 @@ var (
)
func init() {
var err error
tileImage, err = ebiten.NewImage(tileSize, tileSize, ebiten.FilterNearest)
if err != nil {
panic(err)
}
if err := tileImage.Fill(color.White); err != nil {
panic(err)
}
tileImage, _ = ebiten.NewImage(tileSize, tileSize, ebiten.FilterNearest)
tileImage.Fill(color.White)
}
func (t *Tile) Draw(boardImage *ebiten.Image) {

View File

@ -41,22 +41,11 @@ var (
)
func init() {
var err error
playerBarImage, err = ebiten.NewImage(300, 4, ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}
if err := playerBarImage.Fill(&color.RGBA{0x80, 0x80, 0x80, 0xff}); err != nil {
log.Fatal(err)
}
playerBarImage, _ = ebiten.NewImage(300, 4, ebiten.FilterNearest)
playerBarImage.Fill(&color.RGBA{0x80, 0x80, 0x80, 0xff})
playerCurrentImage, err = ebiten.NewImage(4, 10, ebiten.FilterNearest)
if err != nil {
log.Fatal(err)
}
if err := playerCurrentImage.Fill(&color.RGBA{0xff, 0xff, 0xff, 0xff}); err != nil {
log.Fatal(err)
}
playerCurrentImage, _ = ebiten.NewImage(4, 10, ebiten.FilterNearest)
playerCurrentImage.Fill(&color.RGBA{0xff, 0xff, 0xff, 0xff})
}
type Player struct {