Okay, so, I wanted to make a little game, right? And I thought, “Hey, why not a volleyball game with gophers?” Yeah, those cute little groundhogs, but, like, playing volleyball. I’m not a pro developer or anything, I just like messing around with code. Here’s how it kinda went down.

First Steps: The Idea
I started with just a basic idea. Two gophers, a net, and a ball. Simple, right? I figured I’d use Go because, well, gopher… volleyball… it just made sense in my head. Plus, I’ve been dabbling with Go a bit, so it seemed like a fun way to learn more.
Setting Up
First thing I did was set up my Go environment. You know, the usual stuff. Made a new folder for my project, initialized a Go module. Nothing fancy.
Drawing the Gophers
This was the fun part, kinda. I mean, I’m no artist. I decided to use a basic shapes, to make something that resembled. My “gophers” ended up looking more like, uh, brown blobs. But hey, it’s my game, and they’re my blob-gophers. I use circles with rectangles to build the gophers, and set a color and size
Adding the Net and Ball
The net was easy. Just a rectangle in the middle of the screen. The ball was another circle. I spent way too long just tweaking the colors to make them look… okay. I mean, it’s not gonna win any design awards, but it works.
Making Things Move
- I started with the ball. I gave it some basic physics – x and y coordinates, and velocities.
- Then I added some simple keyboard controls for the gophers. One gopher used the arrow keys, the other used ‘W’, ‘A’, ‘S’, ‘D’. Basic stuff.
- The hardest part was getting the collision detection right. I mean, making the ball bounce off the gophers and the net… it took a lot of trial and error. I kept messing up the angles.
Game Logic
I wanted some basic scoring, right? So I added a couple of variables to keep track of each gopher’s score. Every time the ball hit the ground on one side, the other gopher got a point. Displaying the score was pretty straightforward, I just put some text on the screen.
Iterating and Tweaking… A Lot
This whole thing was a lot of back and forth. I’d add something, test it, realize it looked terrible or didn’t work, and then try to fix it. I spent hours just moving things around, changing speeds, adjusting the collision detection. It was a mess, but a fun mess, you know?

The “Finished” Product
Okay, “finished” is a strong word. It’s more like… “I got tired of working on it for now.” It’s a super basic game. The gophers are blobs, the ball physics are wonky, and it’s probably full of bugs. But, it’s my buggy, blob-gopher volleyball game. And I learned a lot making it. I used keyboard to control each gopher moving and jumping,and I set a simple rule that if the ball touch the ground, the opposite side will win a score.
Maybe I’ll add some sound effects later. Or, like, give the gophers little hats. Who knows?