My Java game

Thread in 'Discussion' started by makalaka, 18 Jun 2007.

  1. Not sure what you're trying to say there johnberhenry... jago is very far from a noob, and could probably rewrite that wiki entry blindfolded.
     
  2. johnberhenry

    johnberhenry Unregistered

    There are exceptions though.


    Code:
    |     |  |     |
    |  @  |  | JJ@  |
    | JJJ  | ==> | J   |
    |  @J  |  | J@  |
    +----------+  +----------+
    
    |     |  |     |
    | @   |  | @LL  |
    | LLL  | ==> |  L  |
    | L@  |  |  @L  |
    +----------+  +----------+
    
     
  3. Yes, and they are well known by many people including jago, hence their inclusion on the wiki. [​IMG]
     
  4. EDIT: Me and left/right. Sorry, the wall kick is always checking one column to the right first. Then left! I am too lazy to update this post


    This requires an explaination. Jago is right, and the wiki is right. We just have to combine both and see how they interact together.

    This is the J piece's first and second rotations as it is defined in TGM and TAP:

    Code:
    Rotation 1:
     X1234
    Y
    1 ----
    2 JJJ-
    3 --J-
    4 ----
    
    Rotation 2:
     X1234
    Y
    1 -JJ-
    2 -J--
    3 -J--
    4 ----
    
    Let now say it is possible to get the J piece inbetween those two stack blocks (I am not really sure it is possible without running a simulation):
    Code:
     X1234
    Y
    1 --#-
    2 JJJ-
    3 -#J-
    4 ----
    
    Rotating CCW will be possible at this moment because the free rotation function reads the top row first: [X1,Y1] to [X4,Y1]
    Code:
     X1234
    Y
    1 -??- <-- This row is checks first against the stack blocks
    2 -?--
    3 -?--
    4 ----
    
     X1234
    Y
    1 -?#- <-- There is a relative stack block at [X3,Y1]
    2 -?--
    3 -?--
    4 ----
    
    Once the stack block has been found, a wall kick check is made, first one column to the left:
    Code:
     X1234
    Y
    1 -??# <-- The relative stack block is now at [X4,Y1]
    2 -?--
    3 -?#-
    4 ----
    
    Now we can see the rotation succeeded, but if it didn't because of other stack blocks (not this example), a wall kick check should be made one column to the right
    as well:
    Code:
     X1234
    Y
    1 -#?- <-- The relative stack block would be at [X2,Y1]
    2 -?--
    3 #?--
    4 ----
    
    And now, if that wall kick failed (like it does above), the whole rotation request will fail).


    Last of all, I'll take up the exception that Jago so clearly stated:
    If the column is X2, in any row, no wall kick will be checked, and by that, the whole rotation request will fail!
    Code:
    As part of the free rotation function, fail wall kick (and thereby 
    the whole rotation request) if relative stack block is located 
    at any of the X's in this table:
    
     X1234
    Y
    1 -X--
    2 -X--
    3 -X--
    4 -X--
    - So, to complete the normal search for stack blocks (where no wall kicks are made), columns are read from left to right, and rows from top to bottom (like you read books).
     

Share This Page