Added copyright. Background generation cleanup. Audio tweaks.

This commit is contained in:
2024-11-11 15:00:44 -05:00
parent f6ab64ca6e
commit 6aae03ed18
5 changed files with 17 additions and 12 deletions

View File

@@ -505,7 +505,7 @@ func (g *Game) HandleInput() {
}
//account for controller sensitivity
if !g.gameover {
if !g.gameover && !g.Paused {
xaxis := ebiten.StandardGamepadAxisValue(0, ebiten.StandardGamepadAxisRightStickHorizontal)
yaxis := ebiten.StandardGamepadAxisValue(0, ebiten.StandardGamepadAxisRightStickVertical)
@@ -544,8 +544,8 @@ func (g *Game) ConstructBackground() {
g.background = ebiten.NewImage(g.dimensions.Width, g.dimensions.Height)
BLOCK_SIZE := 32
for i := 0; i < 640/16; i++ {
for j := 0; j < 480/16; j++ {
for i := 0; i < 640/BLOCK_SIZE; i++ {
for j := 0; j < 480/BLOCK_SIZE; j++ {
//select random tile in x and y from tileset
idx_y := rand.IntN(256 / BLOCK_SIZE)
@@ -558,7 +558,7 @@ func (g *Game) ConstructBackground() {
//translate for grid element we're painting
op := &ebiten.DrawImageOptions{}
op.GeoM.Translate(float64(i)*16, float64(j)*16)
op.GeoM.Translate(float64(i*BLOCK_SIZE), float64(j*BLOCK_SIZE))
g.background.DrawImage(assets.ImageBank[assets.TileSet].SubImage(image.Rect(x0, y0, x1, y1)).(*ebiten.Image), op)
}
}