Skip to content

Commit

Permalink
updated go to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
moltenwolfcub committed Aug 22, 2023
1 parent de98f4d commit f1c4f42
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions game/lineart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package game

import (
"image"
"math"

"github.com/hajimehoshi/ebiten/v2"
)
Expand Down Expand Up @@ -164,9 +163,9 @@ func (l lineartEnd) getCheckEnd(rect image.Rectangle) (point image.Point) {
func (l lineartEnd) minMax(pos float64, potentialNew float64) (newPos float64) {
switch l {
case startSide:
newPos = math.Max(pos, potentialNew)
newPos = max(pos, potentialNew)
case endSide:
newPos = math.Min(pos, potentialNew)
newPos = min(pos, potentialNew)
}
return
}
Expand Down
8 changes: 4 additions & 4 deletions game/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ func (p Player) findBounds(layer GameContext) image.Rectangle {
minX, minY := math.MaxFloat64, math.MaxFloat64
maxX, maxY := -math.MaxFloat64, -math.MaxFloat64
for _, seg := range p.GetHitbox(layer) {
minX = math.Min(float64(seg.Min.X), minX)
minY = math.Min(float64(seg.Min.Y), minY)
maxX = math.Max(float64(seg.Max.X), maxX)
maxY = math.Max(float64(seg.Max.Y), maxY)
minX = min(float64(seg.Min.X), minX)
minY = min(float64(seg.Min.Y), minY)
maxX = max(float64(seg.Max.X), maxX)
maxY = max(float64(seg.Max.Y), maxY)
}
bounds := image.Rect(int(minX), int(minY), int(maxX), int(maxY))
return bounds
Expand Down
8 changes: 4 additions & 4 deletions game/river.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func (r River) findBounds(layer GameContext) image.Rectangle {
minX, minY := math.MaxFloat64, math.MaxFloat64
maxX, maxY := -math.MaxFloat64, -math.MaxFloat64
for _, seg := range r.GetHitbox(layer) {
minX = math.Min(float64(seg.Min.X), minX)
minY = math.Min(float64(seg.Min.Y), minY)
maxX = math.Max(float64(seg.Max.X), maxX)
maxY = math.Max(float64(seg.Max.Y), maxY)
minX = min(float64(seg.Min.X), minX)
minY = min(float64(seg.Min.Y), minY)
maxX = max(float64(seg.Max.X), maxX)
maxY = max(float64(seg.Max.Y), maxY)
}
bounds := image.Rect(int(minX), int(minY), int(maxX), int(maxY))
return bounds
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/moltenwolfcub/Forest-Game

go 1.20
go 1.21

require github.com/hajimehoshi/ebiten/v2 v2.5.1

Expand Down

0 comments on commit f1c4f42

Please sign in to comment.