Skip to content

[GAMES] A collection of small game-related projects built using Go and SDL2

Notifications You must be signed in to change notification settings

maxproske/games-with-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Games With Go

I am following Jack Mott's Games With Go series as a reference, which teaches programming in Go through small game-related projects.

Current progress screenshot

Why Go?

  • Simple, readable, performant code.
  • Compiles to native executables. Simplifies sharing games, and doesn't rely on just-in-time compilation.
  • Garbage collection is very low latency, compared to Java or C# which focus on throughput.
  • First-class support for concurrency, memory allocation, and unit testing.

Prerequisites

What things you need to install the software and how to install them.

  • Install Go and Visual Studio Code.
  • Install the Go extension in VSCode. It will generate everything you need.

Installing SDL2

This guide is based on https://github.com/veandco/go-sdl2.

  1. Install GCC for Windows Binding SDL2 in Go requires Windows to compile C code. https://mingw-w64.org/doku.php/download/mingw-builds
  • Version: latest
  • Architecture: x86_64
  • Threads: win32
  • Exception: seh
  • Build revision: latest
  1. Download SDL2 development library (MinGW 32/64-bit). https://www.libsdl.org/download-2.0.php

  2. Drag the contents of SDL2-2.0.8\x86_64-w64-mingw32 into C:\Program Files\mingw-w64\mingw64\x86_64-w64-mingw32

  3. Set Environment variables Add these as new lines to the System Path variable:

  • For SDL2: C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\bin
  • For GCC: C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin
  1. Download SDL2_ttf and SDL2_mixer development libraries (MINGW 32/64-bit).
  1. Get SDL2 bindings for Go
  • $ go get -v github.com/veandco/go-sdl2/{sdl,mix,ttf}

Help

If while installing SDL2 you encounter exit code 3221225781, simply restart your computer.

About

[GAMES] A collection of small game-related projects built using Go and SDL2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages