- Pac-Man
- 06 Mar 2017 04:16:03 pm
- Last edited by RandomGuest on 10 Mar 2017 10:17:26 pm; edited 3 times in total
NOTE: This is not a screenshot
I'm trying to create Pac-Man for the TI-83 plus. I've got the maze, pellets, and Our Humble Hero, but I'm wondering how to do the ghosts. Any suggestions?
Bump: Implemented a new matrix-based scene for the maze and pellets, instead of the old graph based system. Turns out, it's a little slower, but I think the payoff when I put in the ghosts will be worth it.
Code:
BTW, if you're confused as to what that last line is for, complete the maze, exit, and find out.

I'm trying to create Pac-Man for the TI-83 plus. I've got the maze, pellets, and Our Humble Hero, but I'm wondering how to do the ghosts. Any suggestions?
Bump: Implemented a new matrix-based scene for the maze and pellets, instead of the old graph based system. Turns out, it's a little slower, but I think the payoff when I put in the ghosts will be worth it.
Code:
0->theta
1->S
0->T
AxesOff
GridOff
ClrDraw
ZStandard
106->Xmax
72->Ymax
ZInteger
4->Xscl
4->Yscl
GridOn
Line(0,60,94,60,0
{15,23->dim([A]
{4095,1,1533,1029,1525,1029,2037,1->L1
For(A,1,8
For (B,1,12
1+not(2fPart(L1(A)/2^B)-fPart(2L1(A)/2^B->[A](A,B
Ans->[A](16-A,B
Ans->[A](24-B
Ans->[A](16-A,24-B
End
End
For(A,2,14,12
For(B,2,22,20
3->[A](A,B
Pt-On(4B,4A-4,2
Pt-Off(4B,4A-4,3
Pt-On(4B,4A-4
End
End
0->[A](8,12
Pt-Off(48,28
For(A,1,15,2
For(B,1,23,2
If 1=[A](A,B
Then
If A-1
Then
If 1=[A](A-1,B
Line(4B,4A-4,4B,4A-12
End
If B-1
Then
If 1=[A](A,B-1
Line(4B,4A-4,4B-8,4A-4
End
End
End
End
Text(0,0,0
48->X
28->Y
Repeat K=45
getKey->K
If max(K={24,25,26,34,45
Then
(K=26)-(K=24->S
(K=25)-(K=34->T
End
[A](Y/4+1+T,X/4+S->W
If W>1
Then
0->[A](Y/4+1+T,X/4+S
theta+10+90(W=3->theta
Text(0,0,theta
End
For(Z,0,K!=45
If Z
rand(3
Pt-Off(X,Y-1,2
Pt-Off(X,Y+1,2
Pt-Off(X-1,Y,2
Pt-Off(X+1,Y,2
X+2S(1!=W->X
Y+2T(1!=W->Y
Pt-On(X,Y-1,2
Pt-On(X,Y+1,2
Pt-On(X-1,Y,2
Pt-On(X+1,Y,2
If Z
Then
Pt-Off(X+S,Y+T,3
Pt-Off(X+2S,Y+2T,3
End
End
End
Text(0,0,int(1.0085theta
BTW, if you're confused as to what that last line is for, complete the maze, exit, and find out.