• Stars
    star
    339
  • Rank 119,966 (Top 3 %)
  • Language
    Lua
  • Created about 11 years ago
  • Updated almost 9 years ago

Reviews

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

Repository Details

A lua-based Pac-Man clone.

PacPac

This is Pac-Man from a parallel universe.

PacPac Title

PacPac Level Samples

There are 3 mazes to play through. This is thrice as many as the original pac-man :)

You need the löve game engine to play. The current code is written for löve v0.9.2.

The original code was written in under 24 hours as a challenge. My wife didn't believe I could make a pac-man-like game in a day. Here's a fun first 24-hour evolution of the game in screenshots.

How to install and run

  1. Download and install löve. (Current code has been tested with löve v0.9.2.)
  2. Download and unzip the zipfile of this repo.
  3. Double-click the file pacpac.love. Alternatively, in OS X and Ubuntu, type love pacpac.love from the command line - which assumes the love executable is in your path.

Level Editing

I've set up the game so that you can make your own levels without having to know how to program. Just edit level1.txt or any other levelN.txt file to change that level. The file format is explained within those files, and this format is designed to be human-friendly and flexible.

If you're running PacPac using pacpac.love, then you need to run make_love_file.sh before the level changes will show up in the game. This shell script is meant to be run from the command line by cd'ing into your pacpac directory (the one containing make_love_file.sh) and typing the command ./make_love_file.sh.

Contributions

It would be awesome if other coders contributed more levels. I'd like each level to add something new to the game. For now, level 2 adds a new layout and color, which in most games would not count as "new" but since Pac-Man has such a strong 1-layout tradition, I'm counting it as new.

My code philosophy for PacPac is to keep the code a little dirty, as in using global variables freely. Seriously. It's not that dirty is good, but rather that getting things done is good. So I'm asking for contributions that fix bugs or improve gameplay, but are not focused on refactoring. Refactoring is fine as a by-product of other changes, though.

If you'd like to add a level, please read the next section to understand what kind of level designs would fit in with the game. Thanks!

Things That Could be Added

Levels

Below are a few ideas for later levels. It would be cool to arrange them in the game from easiest to hardest.

  • New ghost AI's in different colors.
  • A gun that can shoot ghosts.
  • A level with keys that can open doors. Doors are basically walls that you can erase with a key.
  • A level with portal-like mechanics. Maybe a warp door that changes connected doors, or a warp gun. (This sounds a little scary to have to debug.)
  • A level where the hero and ghosts switch roles. By default, the ghosts are weak - i.e., flashing white/blue and can be eaten. The ghosts eat dots, and if they eat a superdot, then the hero becomes vulnerable - i.e., the ghosts appear non-flashing temporarily. However, the ghosts no longer reincarnate, and it is the hero's goal to eat all of them.

Once we have 10 good and mostly bug-free levels, I'll consider the game to be v1-ready.

Other features

Summary:

  • Tasty foods for bonus points
  • One or maybe two extra lives for certain score points
  • Replay a previously-played game
  • Analytics
  • Server-based high-score-of-the-day

Tasty foods

In the original game, you can eat fruit like apples and oranges. It would be cool to add more fun foods like pizza, burgers, fries, and waffles. Maybe cinnamon rolls. Foods that are tasty and would make for fun pixel art.

Extra lives

In the original game, you also get an extra life once you reach a certain score. This is a nice feature that we could include in PacPac.

Game replay

Automatically save all the effective commands the user provides so that we can exactly replay that game as a watch-only experience. Maybe this could happen automatically for the highest-scoring game, which would be displayed from the title screen if the user is idle.

There are a couple points to be careful about. The game currently uses a random number generator, so we'd have to save the seed used. It also depends on the dt values sent in to update, so we'd have to be careful about how the replay worked with the dt values. That might be tricky. Finally, there is technically analog input available through gamepads, but this can be discretized so that we only need to remember the successful calls to dir_request.

Analytics

By this, I mean heat maps of death locations on each level, and average time-of-life per level. This could help us figure out which levels are most challenging. From there we could do things like modify too-hard or too-easy sections, and make sure the levels are in the right order.

Server-based scores

This is self-explanatory. Even better is being able to download and watch a replay of good high scores.

Credits

This game uses the font 8bitoperator created by GrandChaos9000 (aka Jayvee D. Enaguas) and is distributed under the CC-BY-SA license.

Thanks to jonfk for upgrading the code for löve v0.9.2.

More Repositories

1

termtris

A text-based game inspired by tetris.
Lua
446
star
2

moriarty

A collection of useful Objective-C and iOS classes.
Objective-C
248
star
3

APIsWithLua

Sample Lua and C code to help you learn how to write Lua-based APIs.
C
100
star
4

explacy

A small tool that EXPLains spACY parse results. See what I did there?
Python
82
star
5

lua_api_demo

An educational Lua module that can be used to teach or learn about Lua's C API.
C
80
star
6

wj

bare bones work journal
Python
47
star
7

imghist

Build hue histograms and color pies from png files.
Python
44
star
8

ed2

an ed-like text editor
C
29
star
9

math

A collection of open source math notes.
Jupyter Notebook
29
star
10

video-scripts

Open source scripts for videos I publish on YouTube.
Lua
24
star
11

cstructs

Efficient low-level containers in pure C.
C
11
star
12

lua_c_module_demo

A short example of how to build a Lua module in C.
C
10
star
13

msgbox

A bite-sized tcp/udp library in pure C.
C
9
star
14

calgebra

Linear algebraic algorithms in C.
C
8
star
15

oswrap

a thin layer enabling cross-platform apps
C
8
star
16

dbgcheck

C library to avoid and isolate memory or thread errors.
C
6
star
17

thready

A simple message-passing thread library in C.
C
6
star
18

fh

file helper
Python
6
star
19

trees

Randomly generate low-poly trees in OpenGL on Mac OS X.
C++
4
star
20

a_star_search_demo

This is a small gui/interactive A* search demo in Lua.
Lua
4
star
21

advent_of_code

Code for http://adventofcode.com/
Lua
4
star
22

bounce-beatz

A retro table-tennis-inspired game.
Lua
4
star
23

knuth-taocp

Algorithms and coding problems from Knuth's The Art of Computer Programming.
Python
3
star
24

battleboat

Python
3
star
25

distribution_test

Quick code to test some code to generate certain random variables.
Lua
3
star
26

auto_documenter

Code to augment other code with docstrings and other explanatory verbiage.
Python
3
star
27

cstructs-json

A small C json library for use with cstructs.
C
3
star
28

bigoh_images

Images for an article explaining big-oh notation
Python
3
star
29

json_profile

Find data bottlenecks in large json objects.
Python
2
star
30

foocu

Scratch project for 2d game ideas
Lua
2
star
31

water

An open compiler. Play with language.
Python
2
star
32

gameshell-mac

A basic shell for mac-based OpenGL games.
C++
2
star
33

ccache

A simple LRU cache.
C
2
star
34

daily

Simple organization of things you want to do every n days
Python
2
star
35

cryptogram

An interactive Python script to help you solve your cryptograms.
Python
1
star
36

book_viz

A way to visualize your reading history
Python
1
star
37

shotglass

A micro-library to make servers in Python.
Python
1
star
38

gameshell-win

A basic shell for windows OpenGL games.
C
1
star
39

bf

A brainf*ck interpreter.
C
1
star
40

syncer

A tool to help manage evolving code dependencies.
Python
1
star
41

pumba

A compiler project.
Lua
1
star
42

7date_C

Shell command to get the current 7date, or that of a file.
C
1
star
43

at_once

A Python library to help concurrently run large data pipeline steps in a crash-friendly manner.
Python
1
star
44

dotfiles

Files with dots in their names. That makes sense.
Shell
1
star
45

cheeseburgermogrifier

Lua
1
star
46

beatz

Command-line audio track playing and editing program written in Lua
Lua
1
star
47

blackjack

A simple blackjack app to practice your strategy.
Python
1
star
48

apanga-progress

Apanga's bugs and upcoming features.
1
star
49

dvidump

A human-friendly opcode viewer for dvi files
Python
1
star