Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: Assignment help with how to create scoreboard for tetris game

  1. #1
    Zaiton is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Assignment help with how to create scoreboard for tetris game

    A popular single-player game called Tetris has different coloured blocks and shapes that fall to the bottom.
    The user can rotate the blocks to get a complete solid line of blocks.
    This line is then removed.
    The aim of this game is to get the highest number of complete lines which will be calculated as scores.
    This game keeps a score of users points achieved during every session. The information kept is the userís name, level, score and lines.

    Level ----An increasing number that shows the level of difficulty the user is on. The higher the number, the more fast-paced the game.
    Score ---A number that shows the points achieved when a / line(s) of blocks is / are successfully removed.
    Lines --- The number of lines that are removed.

    This list is only maintained for the top 10 users with the highest scores. If a score achieved is higher than the 10th position, then the new score will replace the old score. The ranking is sorted in a descending order. A typical display of these scores:

    Name Level Score Lines
    Jazzy 8 25081 211
    Peter 7 24099 202
    Dave 6 22188 199
    Cindy 5 20765 178
    Jaskiret 4 18882 165
    Robbie 4 17339 145
    Elton 3 14328 134
    Mel 3 12590 125
    Prince 3 9439 102
    Aaron 2 5628 88

    Based on the information given, create a list that will emulate a Tetris game score list,
    with additions of possibly new higher scores, and thus deleting scores that are below the
    10th entry in the list. Ensure that the list is sorted at all times from the highest to the
    lowest score.


    This is my Assignment : can anyone pls help me its urgent

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Assignment help with how to create scoreboard for tetris game

    Quote Originally Posted by Zaiton View Post
    can anyone pls help me its urgent
    No, it's not urgent. Read the rest of that page to discover why you're not likely to get any help for a question that's nothing more than a homework dump.

    Show your best efforts, and ask a specific question, if you expect to get help on a forum.

    db
    Fubarable likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Assignment help with how to create scoreboard for tetris game

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Zaiton is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Re: Assignment help with how to create scoreboard for tetris game

    Regards Darry

    I am sorry it was not my attention to do so....

    I have 2 project one in PHP and one in Java which I am quite new.....

    As for my question given I have done as below to design table for this info in Dynamic Array list but then I am not sure where I should put my methods for the sorting and how I am suppose to sort the data to the high sore first then input data to be replace in the array list if data is above the data listed in the array and omit the min data.

    package Arraytable;
    // import java lib. function
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.TableCellRenderer;

    public class table extends JPanel
    {
    JTable jt;

    public table()
    {


    String[] columns = {"Name", "Level", "Scores", "Lines"};

    String[][] data = {{"Jazzy","8","25081","211"},
    {"Peter","7","24099","202"},
    {"Dave","6","22188","199"},
    {"Cindy","5","20765","178"},
    {"Jaskiret","4","18882","165"},
    {"Robbie","4","17339","145"},
    {"Elton","3","14328","134"},
    {"Mel","3","12590","125"},
    {"Prince","3","9439","102"},
    {"Aaron","2","5628","88"}};

    jt = new JTable(data,columns)

    {
    public boolean isCellEditable(int data, int columns) {
    return false;
    }

    public Component prepareRenderer(TableCellRenderer r, int data, int columns)
    {
    Component c = super.prepareRenderer(r, data, columns);

    if (data % 2 == 0)
    c.setBackground(Color.WHITE);

    else
    c.setBackground(Color.LIGHT_GRAY);

    if (isCellSelected(data,columns))
    c.setBackground(Color.GREEN);

    return c;

    }

    };

    jt.setPreferredScrollableViewportSize (new Dimension(450,63));
    jt.setFillsViewportHeight(true);

    JScrollPane jps = new JScrollPane(jt);
    add(jps);

    }

    public static void main (String[] args)
    {
    JFrame jf = new JFrame();
    table t = new table();
    jf.setTitle("table");
    jf.setSize(500, 500);
    jf.setVisible(true);
    jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    jf.add(t);

    }
    }

Similar Threads

  1. Normal tetris transform to Tetris with MVC.
    By kuburoman in forum Advanced Java
    Replies: 1
    Last Post: 04-24-2011, 11:53 AM
  2. Breakout game in the assignment 3 cs106
    By dage in forum New To Java
    Replies: 5
    Last Post: 03-16-2011, 06:07 PM
  3. tetris type game--- boundary help
    By ftrengnr in forum New To Java
    Replies: 11
    Last Post: 11-09-2010, 11:00 PM
  4. Replies: 6
    Last Post: 12-15-2009, 03:33 AM
  5. Game of Life assignment
    By javan00b in forum New To Java
    Replies: 4
    Last Post: 04-28-2008, 06:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •