• Stars
    star
    104
  • Rank 330,604 (Top 7 %)
  • Language
    Go
  • License
    Other
  • Created almost 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cat game written in Go

cat-o-licious

This is a simple cat game written in Go, inspired by flappy. My kids were too excited to see flappy's source code and wanted to design and code their own game, so that's what we did together on a rainy Sunday.

The original version uses SDL (like flappy) and works on MacOS, Linux and Windows.

In the wasm directory there's an experimental version in WebAssembly. Most of the code is copied from the SDL version, except for the media handling parts and lack of audio. This allow kids to play the game in a web browser.

Try playing in browser now!

cat-o-licious

Install

If you're not here for the code, and just want to play, you can download binary releases from https://github.com/fiorix/cat-o-licious/releases/.

Keys

Arrows left and right, as well as A and D for lateral movement. F for full screen, and Q to quit.

Playing

You're the cat, and food falls from the top of the screen. The more good stuff you lick the more points you make. The more points you make the more food drops, and it gets really hard to get out of the way of the broccoli, tomatos and pineapples.

My kids love veggies btw, but they say that cats don't.

Building from source

Tested on MacOS, Linux, and Windows. Requires cgo.

Install go-sdl2 bindings:

go get -v -d github.com/veandco/go-sdl2/{sdl,img,mix,ttf}

More information on go-sdl2. go-sdl2 ships with static SDL2 in .go-sdl2-libs/ so you don't have to install SDL for your OS.

Get the code, build static binary:

go get -v -d github.com/fiorix/cat-o-licious
cd $GOPATH/src/github.com/fiorix/cat-o-licious
go build -v -tags static

The assets directory must be relative to the path of the binary. Assets include fonts, images, and sounds used by the game. The font was copied from flappy, images randomly downloaded from the Internet, and the game soundtrack is my daughter's composition in Garage Band. Go figure.

Run:

./cat-o-licious

There's a minimal set of command line flags for things like screen resolution, player speed, and FPS.

WebAssembly

This version has no external dependencies, but requires a web server.

cd wasm
make

Then use a web server to serve the wasm directory and point your browser there.

For local test/dev you can use server.go in the wasm directory.

More Repositories

1

freegeoip

IP geolocation web server
Go
4,931
star
2

wsdl2go

Command line tool to generate Go code from WSDL for SOAP XML services
Go
449
star
3

go-diameter

Diameter stack and Base Protocol (RFC 6733) for the Go programming language
Go
244
star
4

go-smpp

SMPP 3.4 Protocol for the Go programming language
Go
218
star
5

protoc-gen-cobra

Cobra command line tool generator for gRPC clients
Go
189
star
6

go-daemon

Utility to "daemonize" Go programs
C
174
star
7

go-eventsocket

FreeSWITCH Event Socket library for the Go programming language.
Go
125
star
8

eventsocket

Twisted protocol for the FreeSWITCH's Event Socket
Python
54
star
9

go-web

Utilities for http servers written in Go
Go
52
star
10

sms-api-server

HTTP API to send SMS via SMPP
Go
47
star
11

go-redis

Redis client library for Go
Go
45
star
12

txtraceroute

An asynchronous, pure python, traceroute with geolocation information
Python
44
star
13

twisted-twitter-stream

Twitter Stream API for Twisted
Python
43
star
14

jsonschema2go

Code generator for JSON schema
Go
38
star
15

ffmpeg-arm

Docker image with ffmpeg for ARM (Raspberry Pi)
37
star
16

nitgen-bsp

Python extension for Nitgen fingerprint recognition devices
C
22
star
17

mustash

recognize people's face and put a mustache on it
Python
15
star
18

defacer

meow
Go
12
star
19

go-swagger-ui

Go HTTP handler for serving swagger-ui
Go
10
star
20

niosted

Experimental reactor on top of Java NIO
Python
8
star
21

gocp

Go Concurrency Primitives
Go
7
star
22

dotfiles

my set of configuration files
Shell
5
star
23

go-talks

A collection of my Go talks
Go
5
star
24

txdbapi

Experimental ORM for Twisted based on Twistar
Python
4
star
25

pyqrcode

QRcode encoder and decoder for python
Java
4
star
26

go-listener

TCP listener on roids
Go
3
star
27

crosstool-ng-arm

Docker image with crosstool-ng for ARM (Raspberry Pi)
Shell
3
star
28

talkinator

a talking akinator
Python
3
star
29

pyascii85

Ascii85 encoder and decoder for python
C
3
star
30

linvpn

Secure socket layer for pppd (legacy)
C
2
star
31

b3-geoip-plugin

IP Geolocation plugin for the Big Brother Bot
Python
2
star
32

fiorix.github.com

HTML
2
star
33

pbserver

pbcopy and pbpaste over the web
Python
1
star