Learn to Code via Tutorials on Repl.it!

← Back to all posts
Graphics with Go

Getting started with graphics development in Golang on repl.it


Who doesn't love golang? some people, maybe.But no can resist the cuteness of the gopher. Fact.


What I want to say is... I've found a way to do graphics in Go on repl.it. This post teaches you how to make a sample gopher screensaver using a framework called pixel.


Please note that much of the code is from the original tutorials. It strongly recommended to go through them if you do want to make a game in go. To be honest, this is more of a half-baked amalgamation of @eankeen 's original pygame tutorial and the tutorials

The final result will look like this:


A bit glitchy.Don't know why

Getting started

First, start by making a polygott repl here. Or even better, fork my repl at https://repl.it/@Lord_Poseidon/NarrowCrookedExternalcommand. You would see a makefile. Paste this there and make a folder called src

Thanks to @superwhiskers for this code. The reason we are doing this is because repl does not have a Go package manager yet .That makefile gets our dependencies, then runs the code in the folder src .

create a file main.go in src folder and code away!!

my code is mostly from the original tutorials here but these are the changes:

Code changes:

just standard edge detection, speed changing, movement and delay.


the tutorials assume that the source directory is the working directory. This is not the case with us. You have to do src/hiking.png even if you already are in src directory.
Also, I had to resize the original image to make it smaller

Size of the window:

the tutorials assume 1074 by 768 pixels. We at repl.it have only 800 by 600

Thanks again to @superwhiskers and @eankeen. If you do decide to make a game in go,let me know in the comments


How do i fix wireless displays connections in windows 10 http://fixwindows10connections.com thanks for the share this basic information.