forked from Comps-Engi/KodeKombat-game-2011
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKK.txt
59 lines (39 loc) · 1.6 KB
/
KK.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
INPUT FORMAT
input: a string of 5 numbers
g1 g2 g3 g4 p
numbers r from 1-4
up/down/left/right
Image: http://bit.ly/kmU0Vo
MAP FORMAT
20*11
W W W W W W W W W W W W W W W W W W W W
W E e e e W e e e e e e e e W e e e e W
W e W W e W e W W W W W W e W e W W e W
W e W e e e e e e G e e e e e e e W e W
W e W e W W e W W . . W W e W W e W e W
W e e e e e e W G . . . W e e e e e e W
W e W e W W e W W W W W W e W W e W e W
W e W e e e e e e e e e e e e e e W e W
W e W W e W e W W W W W W e W e W W e W
W e e e e W e e e . . . . P W e e e E W
W W W W W W W W W W W W W W W W W W W W
this is an example of the map format in ascii
W-Wall
e-pellets
E-power pellets
G-ghosts
P-pacman
.-eaten pellete
GAME STATE
The game state can be a 2D array i.e a matrix similar to the map matrix.the position of G,P will get updated after each move.
Along with this there are two flags,one for each player (f1 and f2)
to indicate whether the ghosts are active or passive. These flags will
be updated when the other players pacman eats a power pellet
GAME TRACE FORMAT
initial position: MAP
After each input is taken in the co-ordinates of Gs and P are updated.
The previous positions are written with a '.'
If the new position in the matrix contains a e increment score.
If the new position in the matrix contains a E add bonus to score and set f.
If the new position of pacman coincides wid the new position of G and if f is set pacman eats ghost and add bonus to score.
If the new position of pacman coincides wid the new position of G and if f is not set then game ends.