1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice


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.


    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 ???

    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

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

    dzt Active Member Licensed User

    A well developed game.
  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?

    Sub Form1_MouseDown (x,y)
      If (
    x>10 AND x<10 160scale) AND (y>AND y<256 scaleThen
    Int((scale -10) / (16*scale))
    pyInt((scale -5) / (16*scale))

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

    If px >= pXmin AND px <= pXmax Then
    If py pYmin Then
        Else If 
    px <  pXmin
        Else If 
    px >  pXmax
    End If

    End If
    End Sub
  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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice