mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
Bug fix: a rect's size
This commit is contained in:
parent
e2509e3439
commit
8ae31a35dc
@ -44,9 +44,9 @@ func (game *Rects) Update(context ebiten.GameContext) {
|
|||||||
game.rectBounds.X = rand.Intn(context.ScreenWidth())
|
game.rectBounds.X = rand.Intn(context.ScreenWidth())
|
||||||
game.rectBounds.Y = rand.Intn(context.ScreenHeight())
|
game.rectBounds.Y = rand.Intn(context.ScreenHeight())
|
||||||
game.rectBounds.Width =
|
game.rectBounds.Width =
|
||||||
rand.Intn(context.ScreenWidth() - game.rectBounds.X)
|
rand.Intn(context.ScreenWidth() - game.rectBounds.X) + 1
|
||||||
game.rectBounds.Height =
|
game.rectBounds.Height =
|
||||||
rand.Intn(context.ScreenHeight() - game.rectBounds.Y)
|
rand.Intn(context.ScreenHeight() - game.rectBounds.Y) + 1
|
||||||
|
|
||||||
game.rectColor.R = uint8(rand.Intn(math.MaxUint8))
|
game.rectColor.R = uint8(rand.Intn(math.MaxUint8))
|
||||||
game.rectColor.G = uint8(rand.Intn(math.MaxUint8))
|
game.rectColor.G = uint8(rand.Intn(math.MaxUint8))
|
||||||
|
Loading…
Reference in New Issue
Block a user