mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
examples: Remove unneeded error checks
This commit is contained in:
parent
2680884566
commit
9a4a7fe5ba
@ -285,14 +285,8 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
var err error
|
tileImage, _ = ebiten.NewImage(tileSize, tileSize, ebiten.FilterNearest)
|
||||||
tileImage, err = ebiten.NewImage(tileSize, tileSize, ebiten.FilterNearest)
|
tileImage.Fill(color.White)
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
if err := tileImage.Fill(color.White); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Tile) Draw(boardImage *ebiten.Image) {
|
func (t *Tile) Draw(boardImage *ebiten.Image) {
|
||||||
|
@ -41,22 +41,11 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
var err error
|
playerBarImage, _ = ebiten.NewImage(300, 4, ebiten.FilterNearest)
|
||||||
playerBarImage, err = ebiten.NewImage(300, 4, ebiten.FilterNearest)
|
playerBarImage.Fill(&color.RGBA{0x80, 0x80, 0x80, 0xff})
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
if err := playerBarImage.Fill(&color.RGBA{0x80, 0x80, 0x80, 0xff}); err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
playerCurrentImage, err = ebiten.NewImage(4, 10, ebiten.FilterNearest)
|
playerCurrentImage, _ = ebiten.NewImage(4, 10, ebiten.FilterNearest)
|
||||||
if err != nil {
|
playerCurrentImage.Fill(&color.RGBA{0xff, 0xff, 0xff, 0xff})
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
if err := playerCurrentImage.Fill(&color.RGBA{0xff, 0xff, 0xff, 0xff}); err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Player struct {
|
type Player struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user