Coder Social home page Coder Social logo

garageengine's Introduction

GarageEngine

This is a 2d game engine written in Go working on OpenGL. Its an Entity/Component based engine and right now contains lots of features such as: Font,Sprites,Texture packing,Physics,Depth layers,Scenes and more. It feels like Unity3d and share the same names: Scene,Coroutines,Components,Transform,GameObjects etc...

This is an educational project, I'm learning as I go, I cannot promise backwards compatibility at this point.
the name will be probably changed.

Install:

You need to download glfw&glew libraries.

Windows: Use mingw and compile glew.

Linux:
sudo apt-get update
sudo apt-get install build-essential binutils-gold freeglut3 freeglut3-dev libglew-dev libglfw-dev libxrandr2 libxrandr-dev libglew libglew1.8

go get github.com/vova616/GarageEngine

To-Do list

Clean project:
Name changing Engine -> engine etc...
Function changing -> SetWorldPositionf -> SetWorldPosition2d etc...

Atlas,Font - Clean whatever we can.
Material - Think of design that does not require lots of work when creating custom shaders.
Physics - Think of a better design for arbiter and clean & polish stuff.
Scene - Get scene by name.
Tree Behaviours - Clean & polish & new features.
Camera - support multiple cameras.
Rendering - support auto-batching.
Coroutine - try to fix the bug that you cannot access to textures in Coroutines.
Readme - explain Tree Behaviours.
Learn from - https://github.com/runningwild/haunts .
Comments - lacks tons of it.

Dependencies

github.com/go-gl/gl
github.com/go-gl/glfw
github.com/vova616/chipmunk
"github.com/vova616/freetype-go/freetype"

Coroutines(they might be deprecated):

The useage is same as unity coroutines.
Use Behaviour Trees, its better and faster.

Behaviour Trees:

Example in SpaceCookies/game/EnemeyAI.go

SpaceCookies

Mini game to test the engine, it will host server on port 123 then you connect to it. Make sure your executable file is in the same folder with the data folder.

Videos:

http://www.youtube.com/watch?v=iMMbf6SRb9Q
http://www.youtube.com/watch?v=BMRlY9dFVLg

Coroutines Example:

func (sp *PlayerController) Start() {
	as := StartCoroutine(func() { sp.AutoShoot() })
	
	StartCoroutine(func() {
		cr.Sleep(3)
		cr.YieldCoroutine(as) //wait for as to finish
		for i := 0; i < 10; i++ {
			cr.Skip()
			cr.Skip()
			cr.Skip()
			sp.Shoot()
		}
	})
}

func (sp *PlayerController) AutoShoot() {
	for i := 0; i < 3; i++ {
		cr.Sleep(3)
		sp.Shoot()
	}
}

func (sp *PlayerController) AutoShoot2() {
	for i := 0; i < 3; i++ {
		for i:=0;i<3*60;i++ {
			cr.Skip() //Frame skip
		}
		sp.Shoot()
	}
}

func (sp *PlayerController) AutoShoot3() {
	for i := 0; i < 3; i++ {
		done := make(chan bool)
		go func() {
			<-time.After(time.Second * 3)
			done <- true
		}() 
		cr.YieldUntil(done)
		sp.Shoot()
	}
} 

garageengine's People

Contributors

mentaman avatar vova616 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

garageengine's Issues

engine/audio is broken

# github.com/vova616/GarageEngine/engine/audio
./AudioSource.go:129: undefined: openal.DistanceModel

Redesign Activity in GameObjects.

Remove SetActiveRecursive.
The parent will control the whole activity of his children, if the parent is inactive all his children will be inactive too.
This will solve some problems and make the flow easier.

Dependencies have changed?

SpaceCookies looks fun! Just watched the video on YouTube. However...

When installing the dependencies with go get -d in a freshly checked out revision of GarageEngine, I get:

go get -d
engine/Atlas.go:5:2: no buildable Go source files in /home/afr/go/src/github.com/go-gl/gl
engine/Engine.go:11:2: no buildable Go source files in /home/afr/go/src/github.com/go-gl/glfw

More information:

GOPATH=/home/afr/go
go version go1.6 linux/amd64

I see that https://github.com/go-gl/gl seems to import specific versions of the packages.

Are there additional steps I need to take when installing the Go dependencies for GarageEngine?

Better GameObject container design.

Put all of the GameObjects in one array, only the transform will know the relations.
It will vastly increase the performance and solve tons of bugs, but we lose order of GameObjects execution we have now. (its not a problem we could add support for this in the future where we just rearrange the array.)

Problems with gl.Texture ang gl.GLenum

Problems with texture and glenum

I have updated the repo to use:
github.com/go-gl/gl/v2.1/gl

But using it version or other, i always got:

engine/Texture.go:109: undefined: gl.Texture
engine/Texture.go:112: undefined: gl.GLenum
engine/Texture.go:113: undefined: gl.GLenum
engine/Texture.go:115: undefined: gl.GLenum

What i need change to make it work and make a pull-request?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.