Skip to content
Classic pacman with procedurally generated infinite vertical maze.
Go CSS JavaScript HTML Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets changed audio from wav to mp3 & added buffer in new audio player to p… Sep 13, 2018
build added build and usage instructions to the reademe.md fixes #3 Sep 14, 2018
spritetools a little bit of refactoring Sep 13, 2018
.gitignore
LICENSE Initial commit Sep 10, 2018
README.md comment changes Sep 14, 2018
audio.go changed audio from wav to mp3 & added buffer in new audio player to p… Sep 13, 2018
data.go fixed lags when pacman eats a dot, moved dot redering from maze logic… Dec 19, 2018
deploy-pages.sh added pages deploy script Sep 10, 2018
game.go
go.mod updated dependencies to resolve issue #5 Oct 2, 2019
go.sum updated dependencies to resolve issue #5 Oct 2, 2019
grid.go
infinite_eller.go comment changes Sep 14, 2018
infinite_eller_test.go fixed tests Sep 13, 2018
keyboard.go
maze.go
pacman.gif
skin.go code refactor Sep 13, 2018

README.md

Pacman

Go to game Go Report Card

Classic Pacman with procedurally generated infinite vertical maze.

Sample

Motivation

I came across Eller's algorithm for maze generation, a few months back. Eller's algorithm creates a perfect maze, by generating next row, on basis of current row. Giving us ability to create maze with infinite rows.

Since then I have been toying with idea of creating a game around it. It wasn't until a few days ago that I finally decided to use Pacman as the basis for game. I had experimented with Ebiten 2D game engine a bit and this gave me a good opportunity to use it. For maze generation I slightly modified Eller's algorithm to create non-perfect mazes.

Build

Using go get & without go modules.

$ go get -u github.com/skatiyar/pacman
$ cd skatiyar/pacman
$ go get ./...
$ cd build/pacman #goto build dir
$ go build -o pacman main.go
$ ./pacman

Using git clone & go modules.

$ git clone https://github.com/skatiyar/pacman.git
$ cd pacman/build/pacman #goto build dir
$ go build -o pacman main.go
$ ./pacman

Build gh-pages

Golang code is converted to JS by using gopherjs. Ebiten supports browsers by using webgl.

Note: Setup repo beforehand, as shown above.

To build just go code.

$ go get -u github.com/gopherjs/gopherjs
$ cd pacman/build/pacman
$ gopherjs build --tags=pacman --output=pacman.js

To build gh-pages.

$ go get -u github.com/gopherjs/gopherjs
$ cd pacman/build/pacman-pages
$ yarn install && yarn build

How to play

  • Use arrow keys to move pacman.
  • Gain points by eating dots.
  • Ghosts try to chase player and on collision player looses a life.
  • Player starts with 5 lives and can have upto 7.
  • Collect diamond to increase lives.
  • Use flask to gain ability to destroy ghosts, ability lasts for 10 Sec & ghosts try to runaway from player.
  • Eating a running away ghost gives a bonus of 200 points.

Thanks to

You can’t perform that action at this time.