Commit d186ccba authored by Jilin Zheng's avatar Jilin Zheng
Browse files

error with pushNewTetramino method of class GameState

parent 644c8c7d
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -9,15 +9,10 @@
    <option name="autoReloadType" value="NONE" />
  </component>
  <component name="ChangeListManager">
    <list default="true" id="8333e8ef-d99f-4734-9d8f-4661acd87ba6" name="Changes" comment="initial setup of all screens (activities)">
      <change beforePath="$PROJECT_DIR$/.idea/modules/app/AriTetrisburg.app.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/AriTetrisburg.app.iml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/.idea/modules/app/AriTetrisburg.app.main.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/AriTetrisburg.app.main.iml" afterDir="false" />
    <list default="true" id="8333e8ef-d99f-4734-9d8f-4661acd87ba6" name="Changes" comment="link MainActivity to EnterNameScreen">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/aritetrisburg/EnterNameScreen.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/aritetrisburg/EnterNameScreen.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/res/layout/home_screen.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/home_screen.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/res/values/themes.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/themes.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/aritetrisburg/MainActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/aritetrisburg/MainActivity.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/aritetrisburg/Tetramino.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/aritetrisburg/Tetramino.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -104,7 +99,7 @@
    "android-custom-viewC:/Users/peng_/AppData/Local/Android/Sdk/sources/android-33/android/widget/Button.java_SELECTED": "Button",
    "cidr.known.project.marker": "true",
    "last_directory_selection": "C:/Users/Jilin/Desktop/group3project/app/src/main/res/drawable",
    "last_opened_file_path": "C:/Users/Jilin/Desktop/group3project/app/src/main/res/layout",
    "last_opened_file_path": "C:/Users/Jilin/Desktop/group3project/app/src/main/java/com/example/aritetrisburg",
    "settings.editor.selected.configurable": "vcs.Git"
  }
}]]></component>
@@ -113,11 +108,11 @@
      <recent name="com.example.aritetrisburg" />
    </key>
    <key name="CopyFile.RECENT_KEYS">
      <recent name="C:\Users\Jilin\Desktop\group3project\app\src\main\java\com\example\aritetrisburg" />
      <recent name="C:\Users\Jilin\Desktop\group3project\app\src\main\res\layout" />
      <recent name="C:\Users\Jilin\Desktop\group3project\app\src\main\res\values" />
      <recent name="C:\Users\Jilin\Desktop\group3project\app\src\main\res" />
      <recent name="C:\Users\Jilin\Desktop\group3project\app\src\main\res\drawable" />
      <recent name="C:\Users\Jilin\Desktop\group3project\app\src\main\java\com\example\aritetrisburg" />
    </key>
    <key name="android.template.-851266308">
      <recent name="com.example.aritetrisburg" />
@@ -212,7 +207,14 @@
      <option name="project" value="LOCAL" />
      <updated>1682278774054</updated>
    </task>
    <option name="localTasksCounter" value="3" />
    <task id="LOCAL-00003" summary="link MainActivity to EnterNameScreen">
      <created>1682643987484</created>
      <option name="number" value="00003" />
      <option name="presentableId" value="LOCAL-00003" />
      <option name="project" value="LOCAL" />
      <updated>1682643987484</updated>
    </task>
    <option name="localTasksCounter" value="4" />
    <servers />
  </component>
  <component name="Vcs.Log.Tabs.Properties">
@@ -230,6 +232,7 @@
    <MESSAGE value="upload empty project" />
    <MESSAGE value="update issue 6 branch" />
    <MESSAGE value="initial setup of all screens (activities)" />
    <option name="LAST_COMMIT_MESSAGE" value="initial setup of all screens (activities)" />
    <MESSAGE value="link MainActivity to EnterNameScreen" />
    <option name="LAST_COMMIT_MESSAGE" value="link MainActivity to EnterNameScreen" />
  </component>
</project>
 No newline at end of file
+1 −3
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
        game = new FrameLayout(this);
        gameButtons = new RelativeLayout(this);

        delay = 50;
        delay = 500;
        delayLowerLimit = 200;
        delayFactor = 2;

@@ -168,8 +168,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
                    }
                } else {
                    pause.setText(R.string.start_new_game);
                    Intent intent = new Intent(MainActivity.this, GameOverScreen.class);
                    startActivity(intent);
                }
            }
        };
+57 −38
Original line number Diff line number Diff line
@@ -4,12 +4,12 @@ import java.util.Random;

enum TetraminoType {
    SQUARE_SHAPED,
    T_SHAPED,
    L_SHAPED,
    LINE_SHAPED,
    Z_SHAPED,
    INV_L_SHAPED,
    INV_Z_SHAPED;
    CHERRY,
    BANANA,
    STRAWBERRY,
    CUCUMBER ,
    ORANGE,
    PEAR;

    private static final TetraminoType[] VALUES = values();
    private static final int SIZE = VALUES.length;
@@ -28,69 +28,88 @@ class Tetramino {
        Coordinate[] coordinates;

        switch (type) {
            case SQUARE_SHAPED:
            case CHERRY:
                coordinates = new Coordinate[]{
                        new Coordinate(0, 10),
                        new Coordinate(1, 10),
                        new Coordinate(1, 11),
                        new Coordinate(0, 11)
                        new Coordinate(2, 10),
                        new Coordinate(3, 10),
                        new Coordinate(4, 10),
                        new Coordinate(0, 9),
                        new Coordinate(3, 9),
                        new Coordinate(4, 9),
                        new Coordinate(3, 11),
                        new Coordinate(4, 11),
                };
                blocks = this.blocksGenerator(tetraId, 1, coordinates);
                break;
            case INV_L_SHAPED:
            case CUCUMBER:
                coordinates = new Coordinate[]{
                        new Coordinate(0, 10),
                        new Coordinate(0, 11),
                        new Coordinate(1, 10),
                        new Coordinate(2, 10)
                        new Coordinate(2, 10),
                        new Coordinate(3, 10),
                        new Coordinate(4, 10),
                };
                blocks = this.blocksGenerator(tetraId, 2, coordinates);
                break;
            case L_SHAPED:


            case STRAWBERRY:
                coordinates = new Coordinate[]{
                        new Coordinate(0, 11),
                        new Coordinate(0, 10),
                        new Coordinate(1, 10),
                        new Coordinate(2, 10),
                        new Coordinate(1, 9),
                        new Coordinate(2, 9),
                        new Coordinate(1, 11),
                        new Coordinate(2, 11)
                        new Coordinate(2, 11),
                        new Coordinate(3, 10),

                };
                blocks = this.blocksGenerator(tetraId, 3, coordinates);
                blocks = this.blocksGenerator(tetraId, 5, coordinates);
                break;
            case T_SHAPED:
            case ORANGE:
                coordinates = new Coordinate[]{
                        new Coordinate(1, 10),
                        new Coordinate(0, 10),
                        new Coordinate(1, 10),
                        new Coordinate(2, 10),
                        new Coordinate(0, 9),
                        new Coordinate(0, 11),
                        new Coordinate(1, 9),
                        new Coordinate(1, 11),
                        new Coordinate(2, 10)
                        new Coordinate(2, 9),
                        new Coordinate(2, 11),

                };
                blocks = this.blocksGenerator(tetraId, 4, coordinates);
                blocks = this.blocksGenerator(tetraId, 6, coordinates);
                break;
            case Z_SHAPED:
            case BANANA:
                coordinates = new Coordinate[]{
                        new Coordinate(1, 11),
                        new Coordinate(1, 10),
                        new Coordinate(0, 10),
                        new Coordinate(2, 11)
                        new Coordinate(0, 9),
                        new Coordinate(1, 9),
                        new Coordinate(2, 9),
                        new Coordinate(3, 9),
                        new Coordinate(4, 9),
                        new Coordinate(4, 10),
                        new Coordinate(5, 10),
                };
                blocks = this.blocksGenerator(tetraId, 5, coordinates);
                break;
            case INV_Z_SHAPED:
                coordinates = new Coordinate[]{
                        new Coordinate(1, 11),
                        new Coordinate(0, 11),
                        new Coordinate(1, 10),
                        new Coordinate(2, 10)
                };
                blocks = this.blocksGenerator(tetraId, 6, coordinates);
                blocks = this.blocksGenerator(tetraId, 7, coordinates);
                break;
            case LINE_SHAPED:
            case PEAR:
                coordinates = new Coordinate[]{
                        new Coordinate(0, 10),
                        new Coordinate(1, 10),
                        new Coordinate(2, 10),
                        new Coordinate(3, 10)
                        new Coordinate(1, 9),
                        new Coordinate(2, 9),
                        new Coordinate(1, 11),
                        new Coordinate(2, 11),
                };
                        blocks = this.blocksGenerator(tetraId, 7, coordinates);
                        break;

        }
    }