|
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Pac-Man
By: B.Rasmus Anthin
Site: http://www.algonet.se/~anthin
Date: 97-08-03
Description:
Make sure that Matrix A has the dimensions 10x21.
Go to the MAT-icon so that the icon becomes highlighted.
Push [EXE].
Write 10.
Push [EXE].
Write 21.
Push [EXE].
Push [MENU].
This game is like the classic PC-game, where you shall eat up dots and take
yourself to goal when all the dots are gone.
But you have to watch out for the aggressive ghost's.
The game is a little bit slow, but it is only a calculator isn't it.
The game looks almost like this:
#####################
#..O...#.....#......# here is a ghost
#.#.##.#.###.#.##.#.#
#.#....@ .......#.# here is PACMAN
#.#.############# #.#
#.#...#.......#.O.#.# here is one another ghost
#.#.#.#.##.##.#.#.#.#
#.#.#.#.##.##.#.#.#.#
#...#...##U##...#...#
#####################
(But the dots is a little bit more centered).
I've made 4 levels so far.
Use the arrow keys to control PAC-MAN who is the theta-character, (ALPHA + [^]).
I've made it possible to have a time limit in 500 time units. When the time is zero
then you lose.
To pause the game, then just push [EXE], and push [EXE] again to continue.
mail@me If you have any questions or suggestions or find any bugs,
then don't hesitate to mail me. (You're always welcome to give a mail about what you
think about it :))
PACMAN 'program name.
------
ViewWindow 1,127,0,63,1,0
GridOff
AxesOff
LabelOff
For 1 -> A To 45 Step 3
For 1 -> B To 30
Next
Text 30,A," PAC"
Text 30,110-A,"MAN "
Next
Circle 63,15,5
F-Line 63,15,68,15 '97-03-22
Plot 65,13
Plot 1,1
For 1 -> A To 100
Next
F-Line 63,15,66,18
Plot 1,1
Orange Plot 65,16
Orange Plot 66,16
Orange Plot 67,16
Orange Plot 66,17
Orange Plot 67,17
Text 13,72,"."
Text 13,80,"."
Text 13,88,"."
Green Text 50,25,"BY: B.RASMUS ANTHIN"
Orange Text 1,97,"(C) -97"
Do
Text 1,1,"PUSH [EXE]"
LpWhile Getkey <> 31
0 -> @ '@: ALPHA + [^]
0 -> r 'r: ALPHA + [^2]
ClrText
"TIME LIMIT [0/1]"? -> Z '97-08-03
ClrText
Lbl A
Cls
For 1 -> A To 20
Text 25,40,"LEVEL:"
Text 25,75,@+1
Next
Cls
Fill(0,Mat A
For 1 -> I To 10
1 -> Mat A[I,1]
1 -> Mat A[I,21]
Next
For 1 -> I To 21
1 -> Mat A[1,I]
1 -> Mat A[10,I]
Next
@=0 => Prog "LEVEL1"
@=1 => Prog "LEVEL2"
@=2 => Prog "LEVEL3"
@=3 => Prog "LEVEL4"
@=3 => 1 -> r
For 1 -> W To 10
For 1 -> V To 21
Mat A[W,V]=1 => Green Text 6W-5,6V-5,"#"
Mat A[W,V]=0 => 4 -> Mat A[W,V]
Mat A[W,V]=4 => Text 6W-7,6V-5,"."
Next
Next
0 -> E~F
0 -> H
0 -> K~N
0 -> Q~T
0 -> V~Y
500 -> V
Z => Green Text 1,1," " '3 spaces
Lbl 0
If Z
Then Dsz V
V=99 => Text 1,1," " '3 spaces
V=9 => Text 1,1," " '2 spaces
Text 1,1,V
V=0 => Goto 2
IfEnd
If Getkey=31
Then ClrText
" "
For 1 -> W To 50
Next
Do
Locate 8,4,"PAUSED"
Locate 8,4,"PAUSED"
Locate 8,4,"PAUSED"
Locate 8,4," "
Locate 8,4," "
LpWhile Getkey <> 31
IfEnd
0 -> G
C -> E
D -> F
I -> K
J -> L
O -> Q
P -> R
Int 4Ran#+1 -> H
Int 4Ran#+1 -> T
H=1 => Mat A[3+I,2+J] <> 1 => Isz I
H=2 => Mat A[1+I,2+J] <> 1 => Dsz I
H=3 => Mat A[2+I,3+J] <> 1 => Isz J
H=4 => Mat A[2+I,1+J] <> 1 => Dsz J
T=1 => Mat A[3+O,20+P] <> 1 => Isz O
T=2 => Mat A[1+O,20+P] <> 1 => Dsz O
T=3 => Mat A[2+O,21+P] <> 1 => Isz P
T=4 => Mat A[2+O,19+P] <> 1 => Dsz P
K <> I Or L <> J => Text 6(2+K)-5,6(2+L)-4," "
O <> Q Or P <> R => Text 6(2+Q)-5,6(20+R)-4," "
(K <> I Or L <> J) => Mat A[2+K,2+L]=4 => Text 6(2+K)-7,6(2+L)-5,"."
(O <> Q Or P <> R) => Mat A[2+Q,20+R]=4 => Text 6(2+Q)-7,6(20+R)-5,"."
Text 6(2+I)-5,6(2+J)-4,"O"
Text 6(2+O)-5,6(20+P)-4,"O"
D=I-2 => C+9=J => Goto 2
D+2=O => C=P+9 => Goto 2
Getkey=27 => Mat A[4+D,12+C] <> 1 => Isz C
Getkey=38 => Mat A[4+D,10+C] <> 1 => Dsz C
Getkey=28 => Mat A[3+D,11+C] <> 1 => Dsz D
Getkey=37 => Mat A[5+D,11+C] <> 1 => Isz D
D <> 0 => Text 6(4+D)-5,6(11+C)-4,"@"
D=0 => Text 6(4+D)-5,6(11+C)-4,"@"
D <> F Or C <> E => Text 6(4+F)-5,6(11+E)-4," "
PlotOff 1,1
D=I-2 => C+9=J => Goto 2
D+2=O => C=P+9 => Goto 2
If Mat A[4+D,11+C]=2
Then For 1 -> S To 21
For 1 -> T To 10
Mat A[T,S]=4 => Isz G
Next
Next
r=1 => G=0 => Goto 1
r=0 => G=0 => Isz @
r=0 => G=0 => Goto 3
Else 0 -> Mat A[4+D,11+C]
IfEnd
Goto 0
Lbl 1
Text 20,40," " '12 spaces
Text 30,40," "
Green Text 20,40," " '12 spaces
Green Text 30,40," "
For 1 -> A To 5
Green Text 25,40," " '12 spaces
For 1 -> B To 75
Next
Green Text 25,40," YOU WON!!! "
For 1 -> B To 33
Next
Next
0 -> G
Goto 4
Lbl 2
Text 20,40," " '11 spaces
Text 30,40," "
Green Text 20,40," " '11 spaces
Green Text 30,40," "
Green Text 25,40," "
Text 25,40," GAME OVER "
Goto 4
Lbl 3
Text 20,38," " '14 spaces
Text 30,38," "
Green Text 20,38," " '14 spaces
Green Text 30,38," "
Green Text 25,38," "
Do
Text 25,38," LEVEL CLEAR "
LpWhile Getkey <> 31
Goto A
Lbl 4
LEVEL1 'program name
------
For 3 -> I To 8
1 -> Mat A[I,3]
1 -> Mat A[I,19]
Next
For 5 -> I To 17
1 -> Mat A[5,I]
Next
For 10 -> I To 12
1 -> Mat A[3,I]
Next
For 2 -> I To 3
1 -> Mat A[I,8]
1 -> MAt A[I,14]
Next
1 -> Mat A[3,5]
1 -> Mat A[3,6]
1 -> Mat A[3,17]
1 -> MAt A[3,16]
For 9 -> I To 7 Step -1
1 -> Mat A[I,5]
1 -> Mat A[I,9]
1 -> Mat A[I,10]
1 -> Mat A[I,12]
1 -> Mat A[I,13]
1 -> Mat A[I,17]
Next
For 6 -> I To 8
1 -> Mat A[I,7]
1 -> Mat A[I,15]
Next
2 -> Mat A[9,11]
Orange Text 49,61,"U"
0 -> C~D
0 -> I~J
0 -> O~P
LEVEL2
------
For 3 -> I To 17
1 -> Mat A[3,I]
1 -> Mat A[8,I+2]
Next
For 5 -> I To 8
1 -> Mat A[I,3]
1 -> Mat A[I-2,19]
Next
For 5 -> I To 7
1 -> Mat A[I-1,5]
1 -> Mat A[I,7]
1 -> Mat A[I-1,9]
1 -> Mat A[I,11]
1 -> Mat A[I-1,13]
1 -> Mat A[I,15]
1 -> Mat A[I-1,17]
Next
1 -> Mat A[8,20]
2 -> Mat A[9,20]
Orange Text 49,115,"U"
0 -> C~D
0 -> I~J
0 -> O~P
LEVEL3
------
For 2 -> I To 20
1 -> Mat A[3,I]
1 -> Mat A[5,I]
1 -> Mat A[7,I]
Next
1 -> Mat A[9,3]
1 -> Mat A[8,5]
1 -> Mat A[9,7]
1 -> Mat A[8,9]
1 -> Mat A[9,11]
1 -> Mat A[8,13]
1 -> Mat A[9,15]
1 -> Mat A[8,17]
1 -> Mat A[9,19]
For 2 -> I To 9
0 -> Mat A[I,11]
Next
2 -> Mat A[9,2]
Orange Text 49,7,"U"
2 -> I
0 -> J
4 -> O
0 -> P
-9 -> C
-2 -> D
LEVEL4
------
For 2 -> I To 19
1 -> Mat A[5,I]
Next
For 3 -> I To 8
1 -> Mat A[I,3]
1 -> Mat A[I,5]
1 -> Mat A[I,7]
1 -> Mat A[I,9]
1 -> Mat A[I,11]
1 -> Mat A[I,13]
1 -> Mat A[I,15]
1 -> Mat A[I,17]
1 -> Mat A[I,19]
Next
2 -> Mat A[6,2]
Orange Text 31,7,"U"
0 -> I~J
0 -> O~P
0 -> D
1 -> C
Happy Gaming!
//R@z
|