A Game Engine for 2D/3D Games written in go
Windows | Linux | Mac | Android | iOS | Browser | |
---|---|---|---|---|---|---|
Tested | Yes | Yes | No | Yes | No | Yes |
Implemented | Yes | Yes | Yes | Yes | No | Yes |
// For Desktop (Most of them should already be installed)
sudo apt-get install libx11-dev libxrandr-dev libxcursor-dev libxinerama-dev libpthread-stubs0-dev zlib1g-dev libgl1-mesa-dev libxi-dev
// For GTK
sudo apt-get install libgtk-3-dev
// On Windows use msys and execute one of the following commands
pacman -S mingw-w64-x86_64-gtk3 // for 64-Bit
pacman -S mingw-w64-i686-gtk3 // for 32-Bit
// For SDL2
sudo apt-get install libsdl2-dev
// On Windows use msys and execute one of the following commands
pacman -S mingw-w64-x86_64-sdl2 // for 64-Bit
pacman -S mingw-w64-i686-sdl2 // for 32-Bit
// Desktop
// Default (GLFW,OpenGL) if you only want to build desktop applications only execute this command
go get -u github.com/PucklaMotzer09/mathgl/mgl32 github.com/PucklaMotzer09/tmx github.com/ByteArena/box2d github.com/PucklaMotzer09/GLSLGenerator github.com/go-gl/glfw/v3.2 github.com/PucklaMotzer09/go-openal/openal github.com/PucklaMotzer09/go-wav github.com/hajimehoshi/go-mp3 github.com/go-gl/gl/all-core/gl
// Use some of the following commands to build for a different platform or if you want to use
// a different Framework or Renderer
// Always Needed
go get -u github.com/PucklaMotzer09/mathgl/mgl32 github.com/PucklaMotzer09/tmx github.com/ByteArena/box2d github.com/PucklaMotzer09/GLSLGenerator
// For GLFW
go get -u github.com/go-gl/glfw/v3.2 github.com/PucklaMotzer09/go-openal/openal github.com/PucklaMotzer09/go-wav github.com/hajimehoshi/go-mp3
// For SDL2
go get -u github.com/PucklaMotzer09/go-sdl2/sdl github.com/PucklaMotzer09/go-openal/openal github.com/PucklaMotzer09/go-wav github.com/hajimehoshi/go-mp3
// For GTK
go get -u github.com/PucklaMotzer09/go-openal/openal github.com/PucklaMotzer09/go-wav github.com/hajimehoshi/go-mp3
// For OpenGL
go get -u github.com/go-gl/gl/all-core/gl
// Browser
go get -u github.com/gopherjs/gopherjs github.com/PucklaMotzer09/webgl
// Android
go get -u github.com/PucklaMotzer09/go-sdl2/sdl github.com/PucklaMotzer09/android-go/gles2
// For OpenGLES2
go get -u github.com/PucklaMotzer09/android-go/gles2
// For OpenGLES3
go get -u github.com/PucklaMotzer09/android-go/gles3
// For OpenGLES31
go get -u github.com/PucklaMotzer09/android-go/gles31
cd $GOPATH/src/github.com/PucklaMotzer09/GoHomeEngine/src/examples/basic
go build && ./basic
// You should see a gopher in the middle
Optional: Install libraries for audio on android
// If you want to use audio on android you first have to install SDL_mixer with mp3 and ogg support
// This guide is only for linux ubuntu and debian. For other platforms it should be similiar or the
// default precompiled binaries already include mp3 and ogg support.
// go to some directory where you want to store the respositories
cd $GIT_HOME
// clone and install mpg123
git clone https://github.com/kepstin/mpg123.git
cd mpg123
./configure
make -j4
sudo make install
cd ..
// install libvorbis
sudo apt-get install libvorbis-dev
// clone and install SDL_mixer
git clone https://github.com/SDL-mirror/SDL_mixer.git
cd SDL_mixer
./configure --enable-music-mp3 --enable-music-ogg
make -j4
sudo make install
// Now you are ready to use audio on android
The following code describes what is needed to write a game with GoHome
package main
import (
"github.com/PucklaMotzer09/GoHomeEngine/src/frameworks/GLFW"
"github.com/PucklaMotzer09/GoHomeEngine/src/gohome"
"github.com/PucklaMotzer09/GoHomeEngine/src/renderers/OpenGL"
)
type StartScene struct {
}
func (*StartScene) Init() {
}
func (*StartScene) Update(delta_time float32) {
}
func (*StartScene) Terminate() {
}
func main() {
gohome.MainLop.Run(&framework.GLFWFramework{},&renderer.OpenGLRenderer{},1280,720,"Example",&StartScene{})
}
This program opens a window with a black background. To learn more you can look at the examples in src/examples
There is a build tool available with which you can build your games easily for different platforms Read more here.
Version | Tag | Published |
---|---|---|
v0.0.0-20191031083225-5ecc52127ba0 | 5mos ago |