Linie Löschen

This commit is contained in:
Jonas Dernedde 2022-01-24 09:10:21 +01:00
parent 89071d4399
commit 3817308e0c
9 changed files with 40 additions and 16 deletions

2
.idea/Tetris.iml generated
View File

@ -10,7 +10,7 @@
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/Datenbank/sqlite-jdbc-3.36.0.3.jar!/" />
<root url="jar://$MODULE_DIR$/Daenbank/sqlite-jdbc-3.36.0.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />

11
.idea/aws.xml generated Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="accountSettings">
<option name="activeRegion" value="us-east-1" />
<option name="recentlyUsedRegions">
<list>
<option value="us-east-1" />
</list>
</option>
</component>
</project>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -56,6 +56,7 @@ public class Stein {
}
}
}
linieLöschen();
board.setCurrenStein();
return;
}
@ -94,8 +95,8 @@ public class Stein {
if (!collision) {
y++;
}
} else {
}
else {
collision = true;
}
@ -103,6 +104,23 @@ public class Stein {
}
}
public void linieLöschen(){
int bollomLine = board.getBoard().length - 1;
for(int topLine = board.getBoard().length - 1; topLine > 0; topLine--){
int anZahl = 0;
for(int col = 0; col < board.getBoard()[0].length; col++){
if(board.getBoard()[topLine][col] != null) {
anZahl++;
}
board.getBoard()[bollomLine][col] = board.getBoard()[topLine][col];
}
if(anZahl < board.getBoard()[0].length){
bollomLine--;
}
}
}
public void render(Graphics g){
for(int row=0;row< coords.length;row++){
for(int col = 0;col< coords[0].length;col++){

Binary file not shown.