Tetris-2008

Erel

Administrator
Staff member
Licensed 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.

 

Attachments

Erel

Administrator
Staff member
Licensed User
The project was updated and it now handles VGA screens correctly.
It checks the screen resolution at runtime and changes the layout if required.
 

derez

Expert
Licensed 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:

Erel

Administrator
Staff member
Licensed User
You could fix the tabs by clicking on: Tools - Untab (on the desktop you could choose Retab).
It converts tabs to spaces (and vice versa).
 

taximania

Well-Known Member
Licensed User
That has bugged me for ages. I missed the option on the device to detab.

Again, Erel, thanks.
 

derez

Expert
Licensed 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.
 

Erel

Administrator
Staff member
Licensed User
This thread is completely :sign0006:.

The device IDE is limited to strings of up to 64K (Textbox control limit).
If you need to work on larger projects (on the device) you can separate the code into several code files and add them using the Components dialog.
 

alfcen

Well-Known Member
Licensed 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.
 

Erel

Administrator
Staff member
Licensed User
Yes. It checks if Timer1 is enabled and if yes it doesn't do anything.
 

Filippo

Expert
Licensed User
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
 

Erel

Administrator
Staff member
Licensed User
Nice addition.
I've tried it and it is pretty complicated to navigate the objects this way.
 
Top