Search:

Type: Posts; User: wholegrain

Page 1 of 4 1 2 3 4

Search: Search took 0.36 seconds.

  1. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    synchronized void drop(Board board) {

    int [][] a = getArray();
    int [][] b = board.getArray();


    //I don't have currentObject here... what do I need to write? ...
  2. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    How do we refer to the currentPiece object inside drop()?

    synchronized void drop(Board board) {

    int [][] a = getContents();
    int [][] b = board.getContents();

    ...
  3. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    for some reason i can't remove static...


    this doesn't work:

    board = board.getContents();
    shape = currentPiece.getContents();

    --- Update ---
  4. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    currentPiece.contents should not stop falling (fall()) until it touches the last row of board or another contents

    --- Update ---

    Ohhhh... I knoww!!

    Can you tell me how I can do this:

    a =...
  5. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
    0000000000000000
  6. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Is it because of legalDown() and rotateCounterClockWise() running concurrently?

    --- Update ---

    the tetris block stops before it lands on another block or the floor...

    legalDown is supposed...
  7. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    ok nevermind. geeze. ummm when i rotate the objects the shape aren't updated for some reason and they land before they hit anything

    --- Update ---



    umm i just commented out printarray for...
  8. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Help!! When I print the array of board, I only get 0s. Do you know why?

    The pieces aren't there...
  9. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Some information that might be helpful

    In the Piece class, you'll want methods for moving the piece down, moving it left and right by one column, and for rotating the piece clockwise and...
  10. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    I think I need to update shape when I rotate. Do you have any idea how to do this? Because it fills up the array as if they weren't rotated at all... Do I have to write a new method?
  11. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Any tip for debugging?

    Uhmm, I had called addArray in two different places, now I only have it in fall();

    and I remove updateLocation() in 2 places

    Now, it kinda works, but there's an...
  12. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    damnit ... OK it kinda works now, but when I rotate an object there are 2 shapes that are created...
    lol

    http://s12.postimage.org/5c6afasmz/noooo.jpg



    public class Piece extends Grid {...
  13. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 30
    at Board.legalDownSpec(Board.java:74)
    at Board.legalDown(Board.java:122)
    at Piece.fall(Piece.java:92)
    at...
  14. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    if(shape[row][col] == 1 && row == 7)
    {
    return false;
    }


    would this fix it? if row indexes was between 6 and 0, wouldn't this cause an arrayoutofbound?

    --- Update ---
  15. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    public class collisiontest
    {

    public static boolean legalDownSpec(int currentX, int currentY, int[][] board, int[][] shape, int index)
    {
    int x = currentX+1;
    int y = currentY;

    ...
  16. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    http://s18.postimage.org/k2snvv0rb/dfdf_3.jpg

    It somewhat works, but I need the pieces to go all the way down, and I think there is a problem with updateLocation(), because sometimes it doesn't...
  17. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    How do we debug this. I really have a hard trouble debugging the program and understanding why so many things are going wrong.
  18. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Ok... I added the following



    if(x + row == 32)
    {
    return false;
    }
  19. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Well great... it compiles, but I get this:

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
    at Board.legalDown(Board.java:75)
    at Piece.fall(Piece.java:77)
    at...
  20. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Microsoft Windows [Version 6.0.6002]
    Copyright (c) 2006 Microsoft Corporation. All rights reserved.


    C:\Users\->cd C:\Users\-\Desktop\tetris\tocomplete
    ...
  21. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    I think I solved most of the problems, but there is something wrong with the getter method...




    void fall(Board board) {

    int [][] a = getContents();
    int [][] b = board.getContents();
  22. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    int [][] a = currentPiece.getContents();
    int [][] b = board.getContents();



    wait.. these doesn't work, because currentPiece and board aren't created yet? Is that it? So, how do I solve this...
  23. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    Are you sure about that? Because it gives me cannot find symbol when I remove it. It doesn't seem to inherit the method. So how would you go about doing the following:



    void fall() {

    int...
  24. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    I know basic inheritance, but this program is a lot more complex, so it kinda different from the examples I saw.

    I did write this a long time ago, but I don't know how I would use it in this case:...
  25. Re: Changing the attribute of an instance object of a class that's declared in another package and whose variable is constructed by its parent class

    I need to access contents, but do you know how considering that contents is declared in Grid? I thought about declaring contents in Piece and Board, but I don't know if that will work.

    Write a...
Results 1 to 25 of 97
Page 1 of 4 1 2 3 4