- BASIC Tetris [CSE, 8xp, 83p, 73p]
- 11 Sep 2013 09:02:30 pm
- Last edited by tifreak8x on 19 Jan 2014 10:12:36 am; edited 2 times in total
Download: http://www.cemetech.net/programs/index.php?mode=file&id=969
Yes, I know, we have the assembly Tetris, and it's awesome, it really is. Kerm mentioned that a BASIC version wasn't going to work due to Pt-On being dumb with point #2, but it works fine with #1, so I've gone with that.
I've never made or even attempted to make a tetris game before, so this is just as much a test to push myself in new directions with programming as it is just to do this. It runs relatively fast, though I have plans on shoring up the code later. This was just a test run to see if it would work. And I have it set to stop at a certain point so it doesn't drop any further.
Code:
Code:
:DCS
ClrDraw
2->W:5->D:5->C:1->V:V->U:0->T
randInt(10,16->E
1+(E/|E2->E
0->Xmin:0->Ymin
264->Xmax:164->Ymax
Line(114,47,114,117,2,12
Line(148,47,148,117,2,12
Line(116,45,147,45,2,12
{22,10->dim([A]
Fill(0,[A]
randInt(1,4->V
While W=2
1->W
While W=1
If |E2fPart(E)=10:Then
If V=1 or V=2:Then
{3,0,6,0,0,3,3,3->L1:2->A:1->B:End
If V=3 or V=4:Then
{0,0,0,3,3,3,3,6->L1:1->A:2->B:End
End
If |E2fPart(E)=11:Then
If V=1 or V=3:Then
{0,0,3,0,3,3,6,3->L1:2->A:1->B:End
If V=2 or V=4:Then
{3,0,3,3,0,0,0,6->L1:1->A:2->B:End
End
If |E2fPart(E)=12:Then
If V=1:Then
{3,0,0,3,3,3,6,3->L1:2->A:1->B:End
If V=2:Then
{0,0,0,3,0,6,3,3->L1:1->A:2->B:End
If V=3:Then
{0,0,3,0,6,0,3,3->L1:2->A:1->B:End
If V=4:Then
{3,0,3,3,3,6,0,3->L1:1->A:2->B:End
End
If |E2fPart(E)=13:Then
If V>0 and V<5:Then
{0,0,3,0,3,3,0,3->L1:1->A:1->B:End
End
If |E2fPart(E)=14:Then
If V=1 or V=3:Then
{0,0,3,0,6,0,9,0->L1:3->A:0->B:End
If V=2 or V=4:Then
{0,0,0,3,0,6,0,9->L1:0->A:3->B:End
End
If |E2fPart(E)=15:Then
If V=1:Then
{0,0,0,3,3,3,6,3->L1:2->A:1->B:End
If V=2:Then
{0,0,3,0,0,3,0,6->L1:1->A:2->B:End
If V=3:Then
{0,0,3,0,6,0,6,3->L1:2->A:1->B:End
If V=4:Then
{3,0,3,3,3,6,0,6->L1:1->A:2->B:End
End
If |E2fPart(E)=16:Then
If V=1:Then
{0,3,3,3,6,3,6,0->L1:2->A:1->B:End
If V=2:Then
{0,0,0,3,0,6,3,6->L1:1->A:2->B:End
If V=3:Then
{0,0,3,0,6,0,0,3->L1:2->A:1->B:End
If V=4:Then
{0,0,3,0,3,3,3,6->L1:1->A:2->B:End
End
If T=0:Then:1->T:L1->L2:End
3->W
End
While W=3
Pt-Off((115+C*3)+L2(1),(118-D*3)+L2(2),1
Pt-Off((115+C*3)+L2(3),(118-D*3)+L2(4),1
Pt-Off((115+C*3)+L2(5),(118-D*3)+L2(6),1
Pt-Off((115+C*3)+L2(7),(118-D*3)+L2(8),1
D+1(D<19->D
4->W
End
While W=4
Pt-On((115+C*3)+L1(1),(118-D*3)+L1(2),1,|E2fPart(E
Pt-On((115+C*3)+L1(3),(118-D*3)+L1(4),1,|E2fPart(E
Pt-On((115+C*3)+L1(5),(118-D*3)+L1(6),1,|E2fPart(E
Pt-On((115+C*3)+L1(7),(118-D*3)+L1(8),1,|E2fPart(E
L1->L2
2->W
End
End:"W=2
I am very exhausted, so the code isn't pretty, not by a long shot. I'll mess with it more when I'm feeling more up to it.
I would appreciate any feed back as it sits right now. I understand that a BASIC version won't be popular, but as I said, wanting to branch and expand.
thanks in advance!