Bug fix: a rect's size

This commit is contained in:
Hajime Hoshi 2013-10-19 00:57:43 +09:00
parent e2509e3439
commit 8ae31a35dc

View File

@ -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))