mirror of
https://github.com/rjNemo/breakout
synced 2026-06-06 00:26:39 +00:00
fix deprecation warnings
This commit is contained in:
parent
0573a60c29
commit
742a62d5de
1 changed files with 4 additions and 3 deletions
7
main.go
7
main.go
|
|
@ -7,6 +7,7 @@ import (
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/v2"
|
"github.com/hajimehoshi/ebiten/v2"
|
||||||
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
|
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
|
||||||
|
"github.com/hajimehoshi/ebiten/v2/vector"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -94,15 +95,15 @@ func (g *Game) Update() error {
|
||||||
|
|
||||||
func (g *Game) Draw(screen *ebiten.Image) {
|
func (g *Game) Draw(screen *ebiten.Image) {
|
||||||
// Draw paddle
|
// Draw paddle
|
||||||
ebitenutil.DrawRect(screen, g.paddle.x, g.paddle.y, g.paddle.width, g.paddle.height, color.White)
|
vector.DrawFilledRect(screen, g.paddle.x, g.paddle.y, g.paddle.width, g.paddle.height, color.White, true)
|
||||||
|
|
||||||
// Draw ball
|
// Draw ball
|
||||||
ebitenutil.DrawRect(screen, g.ball.x, g.ball.y, g.ball.size, g.ball.size, color.White)
|
vector.DrawFilledRect(screen, g.ball.x, g.ball.y, g.ball.size, g.ball.size, color.White, true)
|
||||||
|
|
||||||
// Draw bricks
|
// Draw bricks
|
||||||
for _, brick := range g.bricks {
|
for _, brick := range g.bricks {
|
||||||
if brick.active {
|
if brick.active {
|
||||||
ebitenutil.DrawRect(screen, brick.x, brick.y, brick.width, brick.height, brick.color)
|
vector.DrawFilledRect(screen, brick.x, brick.y, brick.width, brick.height, brick.color, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue