From 8add12c817e5af9d41bcf96c8387f8c2322b6f04 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 30 Aug 2023 13:50:39 +0200 Subject: fix: Better physics by multiplying by 10 --- main.go | 4 ++-- person.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 6206902..8185bca 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ func NewTile(size Point, position Point, color color.Color) Tile { } var soilColor = color.RGBA{0x60, 0x40, 0x20, 0xff} -var soil = NewTile(Point{280, 200}, Point{20, 20}, soilColor) +var soil = NewTile(Point{2800, 2000}, Point{200, 200}, soilColor) type Game struct { Persons []*Person @@ -71,7 +71,7 @@ func (g *Game) Draw(screen *ebiten.Image) { } func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) { - return 320, 240 + return 3200, 2400 } func main() { diff --git a/person.go b/person.go index 3462aa1..9ca5743 100644 --- a/person.go +++ b/person.go @@ -16,14 +16,14 @@ type Person struct { } func NewPerson(position Point) Person { - image := ebiten.NewImage(10, 10) + image := ebiten.NewImage(100, 100) image.Fill(color.RGBA{0xff, 0xff, 0xff, 0xff}) - selectedImage := ebiten.NewImage(12, 12) + selectedImage := ebiten.NewImage(120, 120) op := &ebiten.DrawImageOptions{} - op.GeoM.Translate(1, 1) + op.GeoM.Translate(10, 10) selectedImage.Fill(color.RGBA{0xff, 0x00, 0x00, 0xff}) selectedImage.DrawImage(image, op) - return Person{Position: position, size: Point{10, 10}, image: image, selectedImage: selectedImage} + return Person{Position: position, size: Point{100, 100}, image: image, selectedImage: selectedImage} } func (p Person) Image() *ebiten.Image { @@ -45,5 +45,5 @@ func (p *Person) MoveTo(destination Point) { } func (p *Person) Update() { - p.Position = p.move.Update(p.Position, 3) + p.Position = p.move.Update(p.Position, 30) } -- cgit v1.3