Code: Select all
tankers code
ClrDraw
AxesOff
FnOff
PlotsOff
Degree
0->Xmin:0->Ymin
1->*delta*X:1->*delta*Y
For(A,0,94,6
randInt(0,18
Line(A,8,A,8+Ans/3
Line(A+1,8,A+1,8+2Ans/3
Line(A+2,8,A+2,8+Ans
Line(A+3,8,A+3,8+Ans
Line(A+4,8,A+4,8+2Ans/3
Line(A+5,8,A+5,8+Ans/3
End
Horizontal 6
randInt(8,20->lT(1
For(A,25,0,-1
Pt-Off(lT(1),A+1,2
Pt-Onn(lT(1),A,2
If pxl-Test(64-A,lT(1:Then
A->lT(2
Text(59-Ans,lT(1)-5,"1
0->A
End
End
For(A,25,0,-1
Pt-Off(lT(3),A+1,2
Pt-Onn(lT(3),A,2
If pxl-Test(64-A,lT(3:Then
A->lT(4
Text(59-Ans,lT(3)-5,"2
0->A
End
End
StorePic 1
1->lT(5
Repeat 0
Pause
ClrDraw
RecallPic 1
ClrHome
Input "Angle:",A
Input "Power:",V
StorePic 1
A+2(90-A)(2=lT(5->A
Vsin(A->V //vertical component
Vcos(A->H //horizontal component
DelVar D.07->T //T is time
lT(2lT(5->E //player 1's position
lT(2lT(5)-1->F //player 2's position
Repeat F+HT>=94 or F+HT<=0 or D<=8 or pxl-Test(int(62-D),int(F+HT //out of bounds or hit something
E+VT-9.8T²->D //vertical position of projectile
Text(57,0,"Alt:",int(Ans
Text(57,22,"Dist:",int(F+HT
Pt-On(F+HT,Ans,3
T+.07->T
End
If 1=lT(5:Then
2->lT(5
Else
If 2=lT(5
1->lT(5
End
End