Tetris-2008

Erel

B4X founder
Staff member
Licensed User
Longtime User
A fully functional Tetris game.
You can see the benefits of the new compiler by running the game from the device IDE and running the included executable.
If anyone is interest with improving this game it still misses background music and sounds, and a highscore table.
I hope it will help you enjoy some of the moments of 2008 ;)

The source code and an installer are included in the zip file.

Tetris.jpg
 

Attachments

  • Tetris.zip
    199.8 KB · Views: 1,942

derez

Expert
Licensed User
Longtime User
Games ???

Erel
And we all were thinking that you are working on improving the compiler....:confused::)
 

colin9876

Active Member
Licensed User
Basic4PC or Basic4PPC?

Erel nicely coded - altho I hate tetris lol!

But it does raise a point thats been in my mind for a while relating to what the target audience is for this product. e.g. programming on a PC (for PPC) or programing on the PPC itself (personally thats where I think this product beats all competition).

Try and look at the source of tetris on the PPC and u will see the problem.
Its not easy to read. Any lines indented twice e.g For, IF, next will be off the page and unreadable as the TABING is long. U would only use one space if coding on the PPC.
 
Last edited:

derez

Expert
Licensed User
Longtime User
file size

The discussion above reminds me that when working on large files I cannot edit them on the ppc - only delete characters but not change or add.
Is this problem only mine ?
when I save the file as text, I can edit it with pword.
 

alfcen

Well-Known Member
Licensed User
Longtime User
A word of praise. I have never been a fan of games and probably never be,
but the programming technique is most remarkable, indeed.
 
D

Deleted member 103

Guest
Hallo Erel,

You can add this code to Tetris?

PHP:
Sub Form1_MouseDown (x,y)
  If (x>10 AND x<10 + 160* scale) AND (y>5 AND y<5 + 256 * scale) Then
    px= Int((x * scale -10) / (16*scale))
    py= Int((y * scale -5) / (16*scale))
    pXmin=9
    pXmax=0
    pYmin=15
    pYmax=0

    For i=0 To 3
      If pXmin>tempX(i) Then pXmin=tempX(i)
      If pXmax<tempX(i) Then pXmax=tempX(i)
      If pYmin>tempY(i) Then pYmin=tempY(i)
      If pYmax<tempY(i) Then pYmax=tempY(i)
    Next

    If px >= pXmin AND px <= pXmax Then
      If py < pYmin Then
        RotateShape
      Else
        timer1_tick
      End If
    Else If px <  pXmin
      MoveShape(-1,0)
    Else If px >  pXmax
      MoveShape(1,0)
    End If

  End If
End Sub

Ciao,
Filippo
 
Top