This discussion is archived
1 Reply Latest reply: Feb 3, 2009 12:41 AM by 843851 RSS

Tetris Source code in Xlets...Somebody please help me with this topic.

843851 Newbie
Currently Being Moderated
Hi,

Hey thanks. I am able to log into the site. I also got the code but again i found that the code is written by taking points and colors to create the shapes. I need some codes in which the shapes are created by taking colored images somewhat in this way,
.
colorImage[0] = TrackPicture.loadImage("./images/square_red.png", 29, 29);
colorImage[1] = TrackPicture.loadImage("./images/square_blue.png", 29, 29);
colorImage[2] = TrackPicture.loadImage("./images/sqaure_yellow.png", 29, 29);
colorImage[3] = TrackPicture.loadImage("./images/sqaure_green.png", 29, 29);

These are the images and by taking co-ordinates they are joined to create shapes. I have tried combining them through the paint( drawImage )method. Please give me some solutions if you have. Thanks in advance.
  • 1. Re: Tetris Source code in Xlets...Somebody please help me with this topic.
    843851 Newbie
    Currently Being Moderated
    Warning: I'm not a game developer, so maybe what I'm going to say has nosense ;)

    What about creating an object for the falling piece? The object control de position of its own squares and check for collisions at the bottom of the screen. Then you should work in the screen as it is a grid where pieces are stored, and everytime the falling object touchs some other piece, check what rows are fully filled and move those which are over it.

    Don't know if it will help you :)

    Cheers