A hand-crafted 2D game library in Go

Overview

Pixel Build Status GoDoc Go Report Card Join the chat at https://gitter.im/pixellib/Lobby Discord Chat

A hand-crafted 2D game library in Go. Take a look into the features to see what it can do.

go get github.com/faiface/pixel

If you are using Modules (Go 1.11 or higher) and want a mutable copy of the source code:

git clone https://github.com/faiface/pixel # clone outside of $GOPATH
cd pixel
go install ./...

See requirements for the list of libraries necessary for compilation.

All significant changes are documented in CHANGELOG.md.

Tutorial

The Wiki of this repo contains an extensive tutorial covering several topics of Pixel. Here's the content of the tutorial parts so far:

Examples

The examples repository contains a few examples demonstrating Pixel's functionality.

To run an example, navigate to it's directory, then go run the main.go file. For example:

$ cd pixel-examples/platformer
$ go run main.go

Here are some screenshots from the examples!

Lights Platformer
Lights Platformer
Smoke Typewriter
Smoke Typewriter
Raycaster Gizmo
Raycaster Gizmo

Features

Here's the list of the main features in Pixel. Although Pixel is still under heavy development, there should be no major breakage in the API. This is not a 100% guarantee, though.

  • Fast 2D graphics
    • Sprites
    • Primitive shapes with immediate mode style IMDraw (circles, rectangles, lines, ...)
    • Optimized drawing with Batch
    • Text drawing with text package
  • Audio through a separate Beep library.
  • Simple and convenient API
    • Drawing a sprite to a window is as simple as sprite.Draw(window, matrix)
    • Wanna know where the center of a window is? window.Bounds().Center()
    • ...
  • Full documentation and tutorial
  • Works on Linux, macOS and Windows
  • Window creation and manipulation (resizing, fullscreen, multiple windows, ...)
  • Keyboard (key presses, text input) and mouse input without events
  • Well integrated with the Go standard library
    • Use "image" package for loading pictures
    • Use "time" package for measuring delta time and FPS
    • Use "image/color" for colors, or use Pixel's own color.Color format, which supports easy multiplication and a few more features
    • Pixel uses float64 throughout the library, compatible with "math" package
  • Geometry transformations with Matrix
    • Moving, scaling, rotating
    • Easy camera implementation
  • Off-screen drawing to Canvas or any other target (Batch, IMDraw, ...)
  • Fully garbage collected, no Close or Dispose methods
  • Full Porter-Duff composition, which enables
    • 2D lighting
    • Cutting holes into objects
    • Much more...
  • Pixel let's you draw stuff and do your job, it doesn't impose any particular style or paradigm
  • Platform and backend independent core
  • Core Target/Triangles/Picture pattern makes it easy to create new drawing targets that do arbitrarily crazy stuff (e.g. graphical effects)
  • Small codebase, ~5K lines of code, including the backend glhf package

Related repositories

Here are some packages which use Pixel:

  • TilePix Makes handling TMX files built with Tiled trivially easy to work with using Pixel.

Missing features

Pixel is in development and still missing few critical features. Here're the most critical ones.

  • Audio
  • Drawing text
  • Antialiasing (filtering is supported, though)
  • Advanced window manipulation (cursor hiding, window icon, ...)
  • Better support for Hi-DPI displays
  • Mobile (and perhaps HTML5?) backend
  • More advanced graphical effects (e.g. blur) (solved with the addition of GLSL effects)
  • Tests and benchmarks
  • Vulkan support

Implementing these features will get us to the 1.0 release. Contribute, so that it's as soon as possible!

Requirements

If you're using Windows and having trouble building Pixel, please check this guide on the wiki.

PixelGL backend uses OpenGL to render graphics. Because of that, OpenGL development libraries are needed for compilation. The dependencies are same as for GLFW.

The OpenGL version used is OpenGL 3.3.

  • On macOS, you need Xcode or Command Line Tools for Xcode (xcode-select --install) for required headers and libraries.
  • On Ubuntu/Debian-like Linux distributions, you need libgl1-mesa-dev and xorg-dev packages.
  • On CentOS/Fedora-like Linux distributions, you need libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel packages.
  • See here for full details.

The combination of Go 1.8, macOS and latest XCode seems to be problematic as mentioned in issue #7. This issue is probably not related to Pixel. Upgrading to Go 1.8.1 fixes the issue.

Contributing

Join us in the Discord Chat!

Pixel is in, let's say, mid-stage of development. Many of the important features are here, some are missing. That's why contributions are very important and welcome! All alone, I will be able to finish the library, but it'll take a lot of time. With your help, it'll take much less. I encourage everyone to contribute, even with just an idea. Especially welcome are issues and pull requests.

However, I won't accept everything. Pixel is being developed with thought and care. Each component was designed and re-designed multiple times. Code and API quality is very important here. API is focused on simplicity and expressiveness.

When contributing, keep these goals in mind. It doesn't mean that I'll only accept perfect pull requests. It just means that I might not like your idea. Or that your pull requests could need some rewriting. That's perfectly fine, don't let it put you off. In the end, we'll just end up with a better result.

Take a look at CONTRIBUTING.md for further information.

License

MIT

Issues
  • Audio

    Audio

    Audio is a major missing feature in Pixel. The time has come to fix this. This issue serves as a design and implementation discussion place as well as progress reporting place.

    Requirements

    Here, I will summarize the most important requirements I demand from the implementation of an audio system in Pixel.

    • Playing sound and music files
    • Playing arbitrary generated stream of PCM samples
    • Support and preference of streaming, even from files
    • Ability to stop the playback at any time
    • Easily play arbitrary number of sounds simultaneously
    • Playback must be smooth, without glitches and as precise in timing as possible
    • Ability to create arbitrary stream-based audio effects in the library as well as by the user of the library (= defining 1 or 2 interfaces for this)

    Design

    Let's define two abstract interfaces with no specific definitions yet:

    1. Wave generator - an object of this type is capable of generating a stream of PCM waves
    2. Wave receiver - an object of this type is capable of receiving a stream of PCM waves and acting accordingly

    Examples: A loaded sound file is a wave generator. A speaker is a wave receiver, since it receives the waves and plays them. An audio effect is both receiver and generator: it receives waves, modifies them and generates the modified waves.

    Having defined these interfaces, here are a few example of ways the user would chain them together to create the final audio result. Objects sending to the right are generators and objects receiving from the left are receivers.

    [ clap.mp3 ] -> [ volume adjustment, 0.5x ] -> [ speaker ]
    [ sine wave generator ] -> [ distortion effect ] -> [ phaser effect ] -> [ speaker ]
    [ music.wav ] -> [speaker ]
    

    The "wave generator" and "wave receiver" names can and probably will change.

    Implementation

    This is not decided yet. Here are a few examples of possible implementation, all of which are a bit problematic.

    1.

    type WaveGenerator interface {
        Generate(format Format, p []byte) (n int, err error)
    }
    
    type WaveReceiver interface {
        Receive(format Format, p []byte) (n int, err error)
    }
    

    I don't like this implementation. For a stream of PCM waves, it requires the user to actively feed the speaker with new data each frame. This would be very hard to use, we would probably implement more abstractions on top of this.

    2.

    type WaveGenerator interface {
        Generate(format Format, p []byte) (n int, err error)
    }
    
    type WaveReceiver interface {
        Receive(WaveGenerator)
        Update()
    }
    

    The way you would use this implementation is like this:

    sound := loadSound("hello.mp3") // WaveGenerator
    effect.Receive(sound)
    speaker.Receive(effect)
    
    for !win.Closed() {
        speaker.Update()
    }
    

    This way, it'd be easy to create arbitrary chains of generators/receivers, however, questions and problems arise when we ask: How to play multiple sounds together? How to stop the playback? How to play two sounds one after another?

    What needs to be done

    First, we need to find an actual design that meets all of the requirements. Then we need to implement it.

    Low level stuff

    For the actual audio playback, we'll use the awesome oto package by @hajimehoshi, which supports audio playback on all major platforms.

    feature 
    opened by faiface 29
  • Pixel is looking for a new maintainer

    Pixel is looking for a new maintainer

    Hey guys, thank you all for sticking around!

    In the last few months, it has become increasingly more clear that I am no longer able to maintain this repository. Pixel is and always will be one of my favorite projects and my proudest achievements. It was my first (and biggest) open-source success and brought me immense joy and satisfaction. Despite this, my focus and interests have shifted over time to other things and I can no longer gather enough motivation to sustainably maintain the project.

    That's why we're looking for a new maintainer. It should be someone, who:

    1. Is a good programmer and is experienced with the Go programming language.
    2. Has (or wants to have) a passion for Pixel.
    3. Is willing to spend time responding to issues, merging pull requests, or perhaps sometimes proposing, designing and implementing new features.
    4. Is willing to make new releases and announce them on Reddit, or other platforms.

    In other words, someone who wants to take good care of Pixel ;)

    If you think you could be this new maintainer, write a reply to this issue.

    The new maintainer will become fully responsible for the repository, I will not interfere with their decisions, but I will always be available for discussions, questions, mostly regarding the general direction of the project. If the new maintainer decides to open a Github Sponsors profile, 100% of the money will go to the new maintainer.

    Once a new maintainer is in place, Pixel will enter a new phase, hopefully, a very prosperous one :P

    That's all, hope we find somebody soon enough!

    opened by faiface 26
  • Logo design proposal

    Logo design proposal

    Hi @faiface Good day! I am a graphic designer/open source enthusiast and i would like to contribute by offering you a logo design which I think will add more to the project's visibility. It is free and i would be glad to do it of course with your permission.Thanks and best regards! - Tobaloidee

    opened by Tobaloidee 22
  • Minimizing Windowed/Fullscreen App Causes Panic

    Minimizing Windowed/Fullscreen App Causes Panic

    OS: Win 10 Go: 1.9

    EDIT: This panic is more general than we had imagined, it will occur if you minimize the application in any way (clicking on the minimize icon, Alt+TAB'ing, clicking on the icon on the taskbar), regardless of the windowed/fullscreen state. Comments up until the issue name change imply this is a fullscreen-only issue, which it is not.

    If you (for example) make the Platformer example fullscreen then Alt+TAB, it will panic with the following:

    panic: reflect: slice index out of range
    
    goroutine 1 [running, locked to thread]:
    reflect.Value.Index(0x539120, 0xc0423ecd20, 0x97, 0x0, 0x539120, 0x2, 0xc042c09cf8)
            C:/tools/go/src/reflect/value.go:871 +0x1eb
    PixelBugTest/vendor/github.com/go-gl/gl/v3.3-core/gl.Ptr(0x539120, 0xc0423ecd20, 0x539120)
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go:44 +0xe4
    PixelBugTest/vendor/github.com/faiface/glhf.NewTexture(0x0, 0x0, 0x0, 0x691f98, 0x0, 0x0, 0x0)
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/glhf/texture.go:47 +0x125
    PixelBugTest/vendor/github.com/faiface/glhf.NewFrame(0x0, 0x0, 0x0, 0x0)
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/glhf/frame.go:37 +0x75
    PixelBugTest/vendor/github.com/faiface/pixel/pixelgl.(*GLFrame).SetBounds.func1()
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/pixel/pixelgl/glframe.go:35 +0x8b
    PixelBugTest/vendor/github.com/faiface/mainthread.Call.func1()
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/mainthread/mainthread.go:64 +0x2d
    PixelBugTest/vendor/github.com/faiface/mainthread.Run(0x58dbd0)
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/mainthread/mainthread.go:46 +0xf8
    PixelBugTest/vendor/github.com/faiface/pixel/pixelgl.Run(0x58dbd0)
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/pixel/pixelgl/run.go:32 +0x60
    main.main()
            C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/pixel/examples/platformer/main.go:394 +0x34
    exit status 2
    

    The error is possibly occurring in the glhf library, and I can confirm that it also happens in my personal project.

    opened by theGeekPirate 21
  • Add text drawing

    Add text drawing

    Currently, Pixel doesn't support drawing text. This needs to be changed. Implementing text drawing in Go is actually way simpler than I thought it would be.

    First of all, there's an awesome package https://godoc.org/golang.org/x/image/font, which implements standard font face interface, which is well designed and very useful. Subpackages implement several font types and https://godoc.org/github.com/golang/freetype/truetype implements TrueType font loading with support of the standard font face interface. So we've got all we need.

    Now, the design of text drawing in Pixel.

    Text drawing should be done in a not-yet-existing "github.com/faiface/pixel/text" package. This package should export (at least) one type: Text. Creating one should be done by text.New(face), where face is a font.Face value. The *Text value returned from New will use that specific font face.

    Text type should implement io.Writer interface, so drawing text to it is as simple as fmt.Sprintf(txt, "hello world"). Printing to Text draws text "to the Text object". To draw the printed text to another target (such as a window, canvas, batch, ...), simply use txt.Draw(target). Clearing needs to be supported too (txt.Clear()).

    Drawing text needs to be fast. There should be no problem drawing a full screen of random text using a tiny font face at 60 FPS without a performance hit. This is something that many other libraries fail to accomplish, but it's actually not very hard. It's easily achievable by caching glyphs.

    So, to recap the interface.

    • "github.com/faiface/pixel/text"
      • New(font.Face) *Text
      • type Text
        • Clear()
        • Draw(pixel.Target)
        • Write(b []byte) (n int, err error)

    This is the basis for the interface. More methods will probably be added, such as WriteString, or SetDot (the position of the text line).

    feature 
    opened by faiface 20
  • How about adding Reset and Printf methods on *text.Text?

    How about adding Reset and Printf methods on *text.Text?

    1. Adding a Reset method on *text.Text would allow us to not having to do this:
    txt.Clear()
    txt.Dot = txt.Orig
    
    1. Adding a Printf(format string, a ...interface{}) (n int, err error) method on *text.Text would allow users of the github.com/faiface/pixel/text package to not directly import fmt

    2. I'd also like us to consider adding a default atlas (text.BasicAtlas) initialized by:

    var BasicAtlas = NewAtlas(basicfont.Face7x13, ASCII)
    

    I believe that doing these changes to the text package would make it more convenient to use. Do you agree @faiface?

    opened by peterhellberg 20
  • Added SetCursorMode()

    Added SetCursorMode()

    http://www.glfw.org/docs/3.1/input.html#cursor_mode

    Mainly implemented to allow window-based mouse locking, but should (and does) support all other cursor modes as well.

    opened by theGeekPirate 17
  • Add No-Brain Jogging to examples

    Add No-Brain Jogging to examples

    Hello Michal,

    first let me tell you that this is a very cool game library that you have created! In the past I have created a lot of little games and other programs in Go, I even have my own little game library which does a very similar job but has not as many features as yours.

    The next Ludum Dare is coming up and I wanted to try using someone else's engine. Looking through the options I found yours very delightful, especially your little gopher game :-)

    In order to get to know your engine in preparation, I ported my last Ludum Dare entry to it. This pull request is mainly to let you know about it (I know how cool it is to see others use your creations) and to say thank you for your effort to create something cool for the open source and especially the Go community! I would love to see a lot more games and desktops apps written in Go.

    A second reason for this PR is that I am very proud of my little game and I think it is great fun so I want to share it with people. Your examples are basically demos to show one or two features of your library in action. The gopher platformer is the closest to a real game. Even though my game is not large or really sophisticated, it is a complete game with graphics, audio, menus, instructions, fun gameplay and high scores. I think it makes for a great addition to your example list for people to see what is possible and to have a "real-life" example of how to use both your pixel and beep libraries.

    Again, you are doing a great job here, keep up the good work!

    PS: I am also working on a big addition to your library, I will create another pull request when that is done... :-)

    opened by gonutz 17
  • Polygon()

    Polygon()

    When I use .Polygon(0) (e.g. fill) and have a complex figure the fill does not just fill the area but also (on the left side?) it colors outside the lines... When switching to .Polygon(1) I have the correct figure, but the lines are not crisp, it seems the line thickness is perpendicular with the actual line. Now the lines seems "hairy" when I zoom in.

    Is there a way to only fill the designated area defined by a closed set of points?

    opened by xinkiknix 17
  • pixelgl.Window bounds and position

    pixelgl.Window bounds and position

    I've noticed that Window.SetBounds() doesn't change the position currently. I'd propose to change the behaviour of SetBounds() so it does change the position of the window. Additionally I'd add a SetSize() (or Resize()) that does change the size only (the current behaviour of SetBounds()). At last I'd make it explicit for now that the Min property of the Window.bounds property isn't used (and set it to zero by default).

    Proposed implementation: Schobers/[email protected]

    opened by Schobers 15
  • Break geometry.go & geometry_test.go into multiple smaller files

    Break geometry.go & geometry_test.go into multiple smaller files

    Closes #286.

    enhancement 
    opened by cebarks 3
  • Add Multisample Anti-aliasing support

    Add Multisample Anti-aliasing support

    This PR adds a new WindowConfig value: SamplesMSAA.

    When this is set to a power of 2, it will enable MSAA for the window.

    opened by cebarks 3
  • Adding new triangles type: TrianglesClipped

    Adding new triangles type: TrianglesClipped

    This new triangle type replaces the first pass at clipping rectangles in favor for a shader-based approach that works better with pixelui's (imgui's) rendering.

    opened by dusk125 4
  • LetterBox scaling

    LetterBox scaling

    Hi,

    Is there any example when we want to resize windows, the game interface will resized and keep the aspect ratio?

    for example: Before resize image

    after resize image

    Thank you. Best regards, Edwin

    opened by edwinsyarief 1
  • Rect.Intersect(Rect) and Rect.Intersects(Rect) have conflicting behaviour

    Rect.Intersect(Rect) and Rect.Intersects(Rect) have conflicting behaviour

    Rect.Intersect specifically calculates the ZR intersection using inclusive operators:

    if t.Min.X >= t.Max.X || t.Min.Y >= t.Max.Y {
    		return ZR
    }
    

    Rect.Intersects uses exclusive operators:

    return !(s.Max.X < r.Min.X ||
    	s.Min.X > r.Max.X ||
    	s.Max.Y < r.Min.Y ||
    	s.Min.Y > r.Max.Y)
    

    I think the former is more convenient, because having 2 rectangles with a perfectly aligned edge is has 0 intersection area. I think I would argue that if the area of intersection is 0, intersects should return false.

    We can see with a simple example, this behaviour is a bit inconsistent. There are no tests for either right now.

    I learned this making a small game with my son, and the overhead of changing and adding tests and creating a PR felt a bit high. But, can do if you need.

    Program to repro:

    package main
    
    import (
    	"fmt"
    	"github.com/faiface/pixel"
    )
    
    func main() {
    	r1 := pixel.R(0, 0, 10, 10)
    	r2 := pixel.R(10, 10, 20, 20) 	// No real overlap, just corners touching.
    	fmt.Println(r1.Intersect(r2)) 	// Output Rect(0, 0, 0, 0)
    	fmt.Println(r1.Intersects(r2)) 	// Output: True
    }
    
    bug 
    opened by btanner 0
  • How to create textured vertex

    How to create textured vertex

    Hi @faiface, is it possible to render line with texture? I want to create rope with texture.

    Thank you.

    opened by edwinsyarief 1
  • Issue in pixelgl, can not import

    Issue in pixelgl, can not import "." package?

    i have a code like this for my idie game:

    package main
    
    import (
    	"github.com/faiface/pixel"
    	"github.com/faiface/pixel/pixelgl"
    )
    
    func run() {
    	// all of our code will be fired up from here
    	cfg := pixelgl.WindowConfig{
    		Title:  "Pixel Rocks!",
    		Bounds: pixel.R(0, 0, 1024, 768),
    	}
    	win, err := pixelgl.NewWindow(cfg)
    	if err != nil {
    		panic(err)
    	}
    	for !win.Closed() {
    		win.Update()
    	}
    }
    
    func main() {
    	pixelgl.Run(run)
    }
    

    But if i build the main.go OR run the file i getting this issue: cannot find package "." in: C:\Go\src\github.com\faiface\pixel\pixelgl

    i tryed: go get github.com\faiface\pixel\pixelgl and go get github.com\faiface\pixel

    awaiting-response environment-problem not-bug 
    opened by TheFlowDevelopment 6
  • Ability to change not only color but font face when writing to a single text object

    Ability to change not only color but font face when writing to a single text object

    As shown in the example it's possible to write to the same text object with different colors.

    basicTxt.Color = colornames.Red
    fmt.Fprintln(basicTxt, "Hello, text!")
    
    basicTxt.Color = colornames.Green
    fmt.Fprintln(basicTxt, "I support multiple lines!")
    
    basicTxt.Color = colornames.Blue
    fmt.Fprintf(basicTxt, "And I'm an %s, yay!", "io.Writer")
    

    Could the same be done with the font face to change the size or font-weigth?

    The workaround for me is to create separate text objects (which is a little bit more effort in terms of aligning those letters properly).

    enhancement needs-triage 
    opened by 3ter 0
  • Drawing primitives

    Drawing primitives

    Is there any other way to draw primitive shapes (rectangles, circles) aside from IMDraw? I couldn't find any other way in the documentation

    awaiting-response 
    opened by quarterpound 2
Releases(v0.10.0)
  • v0.10.0(Aug 22, 2020)

    The big changes from upgrading GLFW have been played with for a sufficient time to tag a non-beta v0.10.0. So here it is!

    Rather busy right now, but hope to get some of the new proposed functionality into the next release.

    Have a peek at the CHANGELOG to see what else is new with this release.

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0-beta(May 10, 2020)

    All changes are now documented in the Changelog so please have a look to see what's new.

    Hello loyal Pixelers!

    This release brings support for GLFW 3.3 and I know you've been excited for it. Some new features from the update are already in, and after a little bit more testing, proper gamepad support should be in the next release. (If you can test gamepads on a Mac, or with a PS controller, please take a look at https://github.com/faiface/pixel/pull/233 !!)

    In just the brief few weeks that I've worked on this project as the new maintainer, I've been very impressed with the strong community support, and I feel this really distinguishes Pixel. Thanks to everyone who's contributed to this library, and especially thank you to its many users.

    Please stay tuned, we hope to have lots more for you soon.

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Oct 10, 2018)

    ... shaders ...

    Wavy gopher

    Less than a year ago I released Pixel 0.7. In the announcement, I declared that I will no longer be working on Pixel so much and instead leave the big things to contributors.

    I am very happy to announce that despite this, Pixel is thriving. And it's not thanks to me but thanks to the great community and new contributors.

    Stats

    • Pixel 0.7 was released on Feb 20, 2018
    • Reached over 1600 stars
    • Closed 70 issues in total
    • Closed 49 pull request, the majority of which got merged

    Changes / new features

    There are two big changes in this release. The first one is boring, the second one is extremely exciting.

    1. Examples were moved to a separate pixel-examples repository as per #135, which shrunk the main repo from ~90MB to <1MB in size.
    2. pixelgl.Canvas got a support for custom fragment shaders. This is a huge and exciting change that happened thanks to @thegtproject. Thank you a lot for that!

    Accompanying the shader support comes a new tutorial so you know how to use them.

    This has been a great time for Pixel and I hope it continues to be. New contributors and users are always warmly welcomed. Just join the chat at https://gitter.im/pixellib/Lobby.

    Source code(tar.gz)
    Source code(zip)
  • v0.7(Feb 20, 2018)

    Almost a year ago, Pixel 0.6 was released. It's time for a new release!

    So, let me introduce to you, the one and only Pixel 0.7.

    This version is mostly an iterative update, an evolution upon Pixel 0.6, not a revolution. However, quite a few changes accumulated since 0.6. One big thing is audio. It's been around for a while, but only now we are announcing it officially. Let's get to the changes!

    Stats

    • Pixel 0.6 was released on May 30, 2017
    • Since then we added 2474 LOC and deleted 168 LOC in 170 commits
    • Reached 1k stars! (became the most starred game library for Go)
    • Closed 51 issues in total
    • Got 13 contributors participating

    Looking for contributors!

    I made the original Pixel with though and care and I think we ended up with a decent library. Since then, I've moved on to other things and Pixel is no longer my main focus. But, there's still a lot of room for improvements. That's why I invite anyone who's interested to help Pixel thrive! Your contributions will be highly appreciated by me as well as many users of Pixel all around the world every day. Check out the short CONTRIBUTING guide to get started!

    New features

    Breaking changes

    Improvements

    • Significant optimizations in IMDraw
    • Partial benchmarks
    • Partial tests
    • Many small optimizations
    • Fixed a number of bugs

    Thank you

    Huge thank you to everyone who contributed to or supported Pixel in any way! Special thanks go to:

    • @seebs, for investing so much time into optimizing IMDraw
    • @PlainSight, for a number of small improvements and tests
    • @svera, for many community examples
    • @peterhellberg, for yet more great community examples and a few useful improvements
    • @mewmew, for helping with the Beep library
    Source code(tar.gz)
    Source code(zip)
  • v0.6(May 30, 2017)

    Finally, approximately a month since the first public Pixel release, we're releasing Pixel 0.6.

    Big thanks to everyone who contributed by sharing ideas, opening issues, or sending pull requests.

    Stats

    • Pixel 0.5 was released on April 25
    • Since then we added 1981 LOC and deleted 469 LOC in 105 commits
    • Gained 478 GitHub stars
    • Closed 19 issues

    New features

    The main goal of 0.6 was text drawing. This goal was quickly accomplished and perfected over the last month. Few more features landed too.

    Breaking changes

    Unfortunately, there are a few very important breaking changes in this release too. I decided to included them, because the old ways were starting to annoy me and I felt like these were the right changes to do. Hopefully, there will be no more breaking changes after this.

    All tutorials and examples were updated according to the breaking changes.

    • Changed Vec implementation from complex128 to a simple struct. This choice was made because although the complex128 implementation allowed for a very nice addition and subtraction using + and - operators, it complicated pretty much every other operation.
    • Removed SetMatrix and SetColorMask from Sprite and replaced the simple sprite.Draw(target) signature with sprite.Draw(target, matrix) and sprite.DrawColorMask(target, matrix, mask) methods. This choice was made, because it avoids a lot of typing and eliminates some state. The same change was done for Canvas, although SetMatrix and SetColorMask methods were kept there, because they serve a different purpose.
    • IMDraw properties were changed from methods to fields. So now, instead of imd.Color(colornames.Red) you write imd.Color = colornames.Red. This is more convenient and allows for retrieving the value easily.

    Improvements

    • Added examples/community directory, for community examples: right now, there's a maze generator by Stephen Chavez
    • Improved documentation in several places
    • Fixed numerous bugs
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Apr 28, 2017)

  • v0.5(Apr 25, 2017)

Owner
Michal Štrba
Infinity is smaller than 380012893427665492.
Michal Štrba
Web-based Cloud Gaming service for Retro Game

CloudRetro provides an open-source cloud gaming platform for retro games. It started as an experiment for testing cloud gaming performance with WebRTC and libretro, and now it aims to deliver the most modern and convenient gaming experience through the technology.

giongto35 1.5k Jul 23, 2021
A small fantasy game engine in WASM using GoLang

The GoLang Fantasy Engine (GoLF Engine) is a retro game engine. It draws inspiration from fantasy console projects like pico-8, tic-80, and pyxle. Like those projects it is designed to be a retro-feeling game creation/playing tool. Unlike those projects GoLF is more minimal in scope and only provides an API and a small set of tools to help you create your games. Tools like an image editor and code editor are not built in. Despite this minimalism creating games in GoLF is still easy and should still maintain the retro game feel.

Brandon Atkinson 75 Jun 7, 2021
This is a "simple" game server. Main functionalities are matching and establishing a connection between players

Game Server This is a "simple" game server. Main functionalities are matching and establishing a connection between players How to Run? run the server

eco 4 Jul 7, 2021
Snake game implemented in golang

little_pineapple(Snake game implemented in golang) 贪吃蛇golang实现 Snake game implemented in golang 数据结构:链表&数组 Data structures used: linked list&array 使用方

null 7 Aug 17, 2020
Snake game made in Go! 🐍

Snake This is a Terminal based snake game made by tristangoossens. Please star this repository to help my first big project grow! Documentation can be

Tristan Goossens 294 Jul 18, 2021
Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Nan Lin 1.9k Jul 25, 2021
♛♔ Play chess against UCI engines in your terminal.

uchess ♛♔ Play chess in your terminal. Introduction uchess is an interactive terminal chess client designed to allow gameplay and move analysis in con

Travis Whitton 30 Jul 11, 2021
Terminal-based game engine for Go, built on top of Termbox

Termloop Termloop is a pure Go game engine for the terminal, built on top of the excellent Termbox. It provides a simple render loop for building game

Joel Auterson 1.2k Jul 18, 2021
🕹️ A basic gameboy emulator with terminal "Cloud Gaming" support

Gameboy.Live ??️ Gameboy.Live is a Gameboy emulator written in go for learning purposes. You can simply play Gameboy games on your desktop: Or, "Cloud

AaronLiu 4.2k Jul 26, 2021
Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

G3N - Go 3D Game Engine Repositories 1.5k Jul 23, 2021
A hand-crafted 2D game library in Go

Pixel A hand-crafted 2D game library in Go. Take a look into the features to see what it can do. go get github.com/faiface/pixel If you are using Mod

Michal Štrba 3.6k Jul 23, 2021
Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Engo 1.4k Jul 26, 2021
Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes

Agones is a library for hosting, running and scaling dedicated game servers on Kubernetes. Agones, is derived from the Greek word agōn which roughly t

GoogleForGames 3.9k Jul 17, 2021
An open source re-implementation of Diablo 2

OpenDiablo2 Join us on Discord! Development Live stream Support us on Patreon We are also working on a toolset: https://github.com/OpenDiablo2/HellSpa

OpenDiablo2 9.6k Jul 26, 2021