danaugrs/gokoban

No Function `GetMaterial`

Nv7-GitHub opened this issue · 3 comments

When I tried installing from source, I got the error:

# github.com/danaugrs/gokoban
go/pkg/mod/github.com/danaugrs/gokoban@v0.0.0-20180818141602-8354b7514160/main.go:548:33: skybox.Graphic.Materials()[i].GetMaterial undefined (type graphic.GraphicMaterial has no field or method GetMaterial)

How can I fix this?

I had the same error on Ubuntu 20.04, March 17, 2021. The following worked for me:

  1. cd $GOPATH/src/github.com/danaugrs

If it does not exist, create the whole precise path, make sure that your GOPATH is not empty.

  1. git clone https://github.com/jtolio/gokoban.git --branch patch-1 --single-branch

This will create gokoban inside danaugrs. This particular branch by jtolio fixes the problem by replacing the line 548 in main.go

sbmat := skybox.Materials()[i].GetMaterial().(*material.Standard)

with

sbmat := skybox.Materials()[i].IMaterial().(*material.Standard)

  1. cd gokoban
  2. go mod init
  3. go mod tidy
  4. go mod vendor
  5. go build
  6. ./gokoban

Thank you! I made a fork and did this

Thanks! Fixed in 2a90032.