FANDOM


This is something I have been working on that will hopefully develop into a game. I have created several uses for it, but so far nothing I like.


The Purpose Edit

This is a program that shows to balls bouncing around the screen. Well, I say balls, but they are only one pixel, so squares would be more accurate. One of the balls you can get to change direction, and you can change the other's direction by running into it. This is mostly for learning purposes, but games can be created around it.

The Code Edit

I use a subprogram to set up the draw window for programs, and you can either create the subprogram on your or copy the text into the actual program.

Graph Set Edit

SetUpEditor LDEL
0→dim(LDEL
If real(Ans(1))=eπ
iLDEL
If not(dim(LDEL))
{0}→LDEL
Float
Func
Full
FnOff 0,1,2,3,4,5,6,7,8,9
PlotsOff 1,2,3
ClrDraw
CoordOff
GridOff
AxesOff
LabelOff
ExprOff
0→Xmin
-62→Ymin
1→ΔX
1→ΔY
If sum(imag(LDEL
Then
Horizontal 0
Horizontal -1
Horizontal -2
Horizontal -60
Horizontal -61
Horizontal -62
Vertical 0
Vertical 1
Vertical 2
Vertical 3
Vertical 91
Vertical 92
Vertical 93
Vertical 94
End
Delvar LDEL

The Program Edit

Lbl 0
ClrHome
Menu("   BALL  DEMO   ","START",1,"HELP",2,"EXIT",3
Lbl 2
ClrHome
Output(1,1,"USE THE ARROWS  TO CHANGE YOUR  BALL'S DIRECTION.
Pause
ClrHome
Goto 0
Lbl 1
ClrHome
eπ
prgmGRAPHSET
4→A
-3→B
1→C
-1→D
0→E
0→G
90→I
-59→J
-1→K
1→L
0→M
0→N
0→O
0→θ
For(H,0,30
Pt-On(randInt(4,90),-randInt(3,59),randInt(1,3
End
While θ≠23 and θ≠45
getKey→θ
If θ=24 or θ=26
C-2C((C<0 and θ=26) or (C>0 and θ=24))→C
If θ=25 or θ=34
D-2D((D<0 and θ=25) or (D>0 and θ=34))→D
If √((A-I)2+(B-J)2)≤1
Then
C→U
D→V
K→C
L→D
U→K
V→L
End
pxl-Test(-B-D,A+C)→E
pxl-Test(-B-D,A)→F
pxl-Test(-B,A+C)→G
If E+F+G
Then
If ((E xor F) and (E xor G)) or(E and F and G) or (F and not(G
-D→D
If ((E xor F) and (E xor G)) or(E and F and G) or (G and not(F
-C→C
End
Pt-Off(A,B
A+C→A
B+D→B
Pt-On(A,B
pxl-Test(-J-L,I+K)→M
pxl-Test(-J-L,I)→N
pxl-Test(-J,I+K)→O
If M+N+O
Then
If ((M xor N) and (M xor O)) or (M and N and O) or (N and not(O
-K→K
If ((E xor F) and (E xor G)) or (M and N and O) or (O and not(N
-L→L
End
Pt-Off(I,J
I+K→I
J+L→J
Pt-On(I,J
End
If θ=45
Goto 1
Goto 0
Lbl 3
ClrHome
ClrDraw
Output(1,1,"

NOTE Edit

This works well on a TI 84 Plus Silver calculator. It probably doesn't on other types.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.