GithubHelp home page GithubHelp logo

happy-ferret / grout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zeroshade/grout

0.0 1.0 0.0 508 KB

2D Game Engine using Go and SFML

License: GNU General Public License v2.0

Go 100.00%

grout's Introduction

Grout

2D Game Engine using Go and SFML


Requires

Tiled and the darkFunction Editor aren't necessarily required, they just happened to be what I used when created the assets and thus used their formats for reading stuff in. Anything using the same formats will work.


It is a task-based game engine that I'm now adding entity/component architecture for handling game objects.


A basic main using the engine would be:

func main() {
  tm := grout.GetTaskManager()
  initalState := InitialGameStateObject{}
  grout.InitialGameState(&initialState)
  tm.Execute()
}

Where the InitialGameStateObject has the following functions defined on it

  • OnPause() when the state is pushed down on the stack
  • OnResume(w *sf.RenderWindow) when the state is put back on top of the stack, given the render window for any setup
  • Init(w *sf.RenderWindow) when the engine first puts the state on the stack, this is called
  • Update() (grout.GameState, bool) called once per frame for updating state, return a new gamestate to push onto the stack or nil, return bool to say whether this current state should be popped off
  • Draw(w *sf.RenderWindow) called once per frame to draw whatever is needed by the state

grout's People

Contributors

zeroshade avatar

Watchers

 avatar

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.