forked from ziw/Javascript-Pacman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
99 lines (60 loc) · 2.88 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
..._ ____ ___ ________ ______ _ __
.' `. / __ \/ | / ____/ |/ / | / | / /
: o _.-' / /_/ / /| |/ / / /|_/ / /| | / |/ /
: `-._ / ____/ ___ / /___/ / / / ___ |/ /| /
`. .' /_/ /_/ |_\____/_/ /_/_/ |_/_/ |_/
`-...-'
Developed by: Zi Wang (ziw), Bingying Xia (bxia)
//////// How to Play /////////
On welcome screen, press S to start the game.
Use arrow keys or WASD to move, Q to pause, E to resume, and R to restart.
Gaming mechanics is just like the original Pacman.
In case you were living under a rock and doesn't know what Pacman is (or too
young to know), here's a brief summary (of the parts that we implemented):
- Eat pellets to earn points.
- Don't get eaten by ghosts or you'll die a very painful death.
- Eat power pellets to briefly enter freight mode, where you can take revenge.
- Each ghost has a different personality, so study it well to win.
Scoring is as follows:
- 10 pts for each pellet
- 50 pts for each power pellet
- 200 for the first ghost eaten in freight mode, double the previous score for
each additional ghost eaten in the same occurance of freight mode (i.e. 200
for the 1st, 400 for the 2nd, 800 for the 3rd, resets for every freight mode).
*******!!! SUPER ULTRA SECRET CHEAT !!!*******
* Press G at start screen to enter GOD MODE. *
* (You didn't hear it from us.) *
**********************************************
References used for gaming mechanics:
Understanding Pac-Man Ghost Behavior -- GameIntervals
http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior
The Pac-Man Dossier -- Jamie Pittman
http://home.comcast.net/~jpittman2/pacman/pacmandossier.html
//////// Concepts Used /////////
JavaScript
- Function callbacks
setInterval() used to refresh game, setTimeOut() used to pause screen
shortly during countdown to start.
- Anonymous function
Used with setTimeOut during countdown.
- Optional parameters
Run() takes an optional parameter of isGodMode to determine whether or not
to enter god mode.
- Arrays
Used for constructing game board grids (2-D array), keeping record of ghosts
and lives left, and an assortment of other various elements.
- Objects
Pacman, ghosts, and grids are all objects.
They have constructors, properties, parameters, prototypes, overridden
toString() methods, etc.
HTML5 Canvas
- Rectangles, rectangles everywhere.
Used for grids, covering up areas that need to be refreshed, etc.
- Strokes and fills
For drawing everything.
- Paths, arcs, circles
For drawing Pacman and ghosts.
- Text
For showing welcome screen, instructions, and scores.
- Keyboard events
Used to make Pacman move.