Tetris-2008

Discussion in 'Open Source Projects' started by Erel, Jan 1, 2008.

  1. Erel

    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.

    [​IMG]
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Current highscore: 475, level 12
     
  3. Erel

    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.
     
  4. derez

    derez Expert Licensed User

    Games ???

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

    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: Mar 15, 2008
  6. Erel

    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).
     
  7. taximania

    taximania Well-Known Member Licensed User

    That has bugged me for ages. I missed the option on the device to detab.

    Again, Erel, thanks.
     
  8. derez

    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.
     
  9. Erel

    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.
     
  10. derez

    derez Expert Licensed User

    Erel
    sorry, I appologize.
    thanks for the reminder.
     
  11. dzt

    dzt Active Member Licensed User

    A well developed game.
    :sign0098:
     
  12. alfcen

    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.
     
  13. nandlal_mk

    nandlal_mk New Member

    New game option work only on start, not during game.
    Is it so?
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Yes. It checks if Timer1 is enabled and if yes it doesn't do anything.
     
  15. Filippo

    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 160scale) AND (y>AND y<256 scaleThen
        px
    Int((scale -10) / (16*scale))
        
    pyInt((scale -5) / (16*scale))
        
    pXmin=9
        pXmax
    =0
        pYmin
    =15
        pYmax
    =0

        
    For i=0 To 3
          
    If pXmin>tempX(iThen pXmin=tempX(i)
          If 
    pXmax<tempX(iThen pXmax=tempX(i)
          If 
    pYmin>tempY(iThen pYmin=tempY(i)
          If 
    pYmax<tempY(iThen 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
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Nice addition.
    I've tried it and it is pretty complicated to navigate the objects this way.
     
  17. chengjunzh

    chengjunzh Member Licensed User

    thanks for share

    learning
     
Loading...