EngoEngine / engo

Engo is an open-source 2D game engine written in Go.
https://engoengine.github.io
MIT License
1.73k stars 137 forks source link

Added Go embed demo (Go 1.16) #759

Closed eth0net closed 3 years ago

eth0net commented 3 years ago

Added a demo to show how to embed assets using the new Go embed package.

Does require go.mod to be set to Go 1.16 so this should probably be held back for a while.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+3.5%) to 40.969% when pulling 60f0ae9e8078fe92a5bbf4d38715b7c7ed178fd5 on eth0net:embed-demo into a5117b519889c9d71afb46cece0b18f87fbbdb73 on EngoEngine:master.

eth0net commented 3 years ago

Ah yeah forgot the GitHub actions would need updating, updating those now.

eth0net commented 3 years ago

Okay so still not passing... think I'll just keep this aside for later. Once 1.16 is more established and Engo maybe gets a go.mod update for some reason besides this it can be looked into again.

For anyone looking to embed using Go embed, examples can be provided elsewhere worst case.

eth0net commented 3 years ago

Reopened as WIP to keep it tracked here for the future.

Noofbiz commented 3 years ago

I fixed the traffic manager issues, so they should pass if they re-run. The only issue I see is I think engo's go mod version should stay 1.14. Even though 1.16 is required for the embedding, that's not a feature engo itself uses so it shouldn't need to increase the version for it.

eth0net commented 3 years ago

Thanks, yeah I was thinking it's probably best to leave the go version for Engo as 1.14. Unfortunately, since the demo is within the module it fails to build without the update to go.mod.

eth0net commented 3 years ago

Just looking to see if there is a way to set the -lang flag for build as that could be a way round it, maybe.

eth0net commented 3 years ago

Can't see a way around it for now, unfortunately. The demo can live elsewhere in the meantime though, such as just in the README file.

Noofbiz commented 3 years ago

Alright, got the CI stuff working. Turns out the go.mod includes the demos, but it's not a hard/fast rule. I think 1.16 is mature enough at this point to move up to it if you want to merge this in. Looks good to me!

eth0net commented 3 years ago

Ah well if you're happy to up the Go version then go ahead with the merge, I believe this is all ready!