Closed F483 closed 8 years ago
@F483 What go version are you running? I know that apt-get uses an older version of go so that might be the issue.
$ go version
go version go1.2.1 linux/amd64
That's why @F483 Follow these instructions: https://www.digitalocean.com/community/tutorials/how-to-install-go-1-6-on-ubuntu-14-04
I'll put them here just in case: But first make sure you uninstall go1.2.1 by running
sudo apt-get uninstall golang && sudo apt-get uninstall gccgo
sudo apt-get update
sudo apt-get -y upgrade
sudo curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
sudo tar -xvf go1.6.linux-amd64.tar.gz
sudo mv go /usr/local
sudo nano ~/.profile
export PATH=$PATH:/usr/local/go/bin
` ``
After that just set your GOPATH environmental variable (Where all your Go code will live) example: ~/Go or ~/Documents/Go or ~/GoCode all up to you. Let me know how it goes.
Thanks that seemed to work.
Alright glad that you've got that fixed! @F483
I now get the following though when I try to run the Getting Started example.
$ go run main.go
main.go:6:2: cannot find package "github.com/engoengine/ecs" in any of:
/usr/local/go/src/github.com/engoengine/ecs (from $GOROOT)
/home/f483/dev/go/src/github.com/engoengine/ecs (from $GOPATH)
main.go:7:2: cannot find package "github.com/engoengine/engo" in any of:
/usr/local/go/src/github.com/engoengine/engo (from $GOROOT)
/home/f483/dev/go/src/github.com/engoengine/engo (from $GOPATH)
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/f483/dev/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
@F483 Easy fix, the getting started needs to be fixed: change your imports to engo.io/engo and engo.io/ecs respectively. I'd recommend you look at the site for tutoraisl (engo.io)
Edit: updated the wiki
I replaced it with this and get the following error.
$ go run main.go
# command-line-arguments
./main.go:34: cannot use myGame literal (type *myGame) as type engo.Scene in argument to engo.Run:
*myGame does not implement engo.Scene (missing Exit method)
@F483 Just add:
func (*myGame) Exit() {}
Sorry about this, this is a recent change and not every example has been updated.
No problem, glad to help find the documentation errors.
Now it works but I cant close the window (via button or ctrl-c). It keeps printing the following output:
2016/04/14 14:17:31 Warning: default close action set to false, please make sure you manually handle this
I had to kill the process :/
@F483 May I see your source code?
$ cat main.go
package main
import (
"engo.io/ecs"
"engo.io/engo"
)
type myGame struct{}
// Type uniquely defines your game type
func (*myGame) Type() string { return "myGame" }
// Preload is called before loading any assets from the disk,
// to allow you to register / queue them
func (*myGame) Preload() {}
// Setup is called before the main loop starts. It allows you
// to add entities and systems to your Scene.
func (*myGame) Setup(*ecs.World) {}
// Show is called whenever the other Scene becomes inactive,
// and this one becomes the active one
func (*myGame) Show() {}
// Hide is called when an other Scene becomes active
func (*myGame) Hide() {}
func (*myGame) Exit() {}
func main() {
opts := engo.RunOptions{
Title: "Hello World",
Width: 400,
Height: 400,
}
engo.Run(opts, &myGame{})
}
@F483 I know the issue, I'm on it right now.
@F483 In the meantime add this to your Exit() function:
engo.Exit()
I am in process of sending in a pull request to fix that issue.
Thanks!
@F483 Would you mind joining the gitter chat, I'd like to talk to you beyond this PR. (https://gitter.im/EngoEngine/engo)
Update: with https://github.com/EngoEngine/engo/pull/199 you don't need to manually exit the engine anymore unless you set the default close action to false. so @F483 run the following to update to the latest version:
go get -u engo.io/engo
I'm new to go (learning by making a game with engo) so it may be a misunderstanding on my part.