Skip to content

Commit ef6d581

Browse files
author
Nolin Reddy
committed
added increasing speed
1 parent 101bf1c commit ef6d581

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/main/java/com/example/javafx/JavafxApplication.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public static void main(String[] args) {
2323
var ctx = new SpringApplicationBuilder(JavafxApplication.class)
2424
.headless(false).run(args);
2525

26-
EventQueue.invokeLater(() -> {
27-
28-
var ex = ctx.getBean(JavafxApplication.class);
29-
ex.setVisible(true);
30-
});
26+
// EventQueue.invokeLater(() -> {
27+
//
28+
// var ex = ctx.getBean(JavafxApplication.class);
29+
// ex.setVisible(true);
30+
// });
3131
}
3232
}

src/main/java/com/example/javafx/Shape.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class Shape {
1515

1616
private boolean collision = false, moveX = false;
1717

18-
private int normalSpeed = 600, speedDown = 60, currentSpeed;
19-
18+
private int speedDown = normalSpeed/5, currentSpeed;
19+
private static int normalSpeed = 500;
2020

2121
private long time, lastTime;
2222

@@ -41,6 +41,9 @@ public void update(){
4141

4242
if(collision)
4343
{
44+
if(normalSpeed != 0)
45+
normalSpeed -= 20;
46+
System.out.println(normalSpeed);
4447
for(int row = 0; row < coords.length; row++)
4548
for(int col = 0; col < coords[row].length; col++)
4649
if(coords[row][col] != 0)
@@ -118,7 +121,7 @@ private void checkLine(){
118121
if(count < board.getBoard()[0].length)
119122
height --;
120123

121-
124+
122125
}
123126

124127

0 commit comments

Comments
 (0)