Skip to content

Commit 08c2146

Browse files
committed
First commit in a while
1 parent d9e28bf commit 08c2146

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ I have uploaded native releases in the releases section.
77
A to move left, D to move right. M to open the menu. In the menu, there is a mouse mode. Use mouse mode to control the paddle with your mouse. There is also controller support. You just need to make sure that your controller is connected to your computer. If your controller can vibrate, it will vibrate if the ball hits something other than the ground. There is also a challenge mode for controllers that can vibrate which will cause the controller to vibrate very fast while the setting is turned on.
88

99
Web Version: [Click Here](https://jthecoder12.github.io/BrickBreakerNew)
10-
The web version won't be as good as I had to minimize it for TeaVM support so there is no multiplayer, controller support, or ImGui menu. The positioning may also be off as the game takes up the entire browser page.
10+
The web version won't be as good as I had to minimize it for TeaVM support so there is no multiplayer, controller support, or ImGui menu. The positioning may also be off as the game takes up the entire browser page. Also expect the web version to get less bug fixes and later updates.
1111

1212
Images:
1313
![titlescreen](https://github.com/user-attachments/assets/1b193243-0a41-447f-9fdb-51e1d2349ca6)

core/src/main/java/brickbreaker/main/objects/Ball.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public Ball(@NotNull Engine engine, SingleplayerScene main) {
2323

2424
public void render(int speed) {
2525
getComponent(CircleComponent.class).render();
26-
getComponent(CircleComponent.class).position.add(speed*1.75f*main.sideDirection, speed*main.ballDirection);
26+
getComponent(CircleComponent.class).position.add(speed*105*Gdx.graphics.getDeltaTime()*main.sideDirection, speed*60*Gdx.graphics.getDeltaTime()*main.ballDirection);
2727

2828
getComponent(CircleCollider.class).updatePosition(getComponent(CircleComponent.class).position);
2929

core/src/main/java/brickbreaker/main/objects/Paddle.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ public void render(ImBoolean mouseMode, Ball ball) {
3333

3434
getComponent(BoxCollider.class).updatePosition(getComponent(RectComponent.class).position);
3535

36-
if(Gdx.input.isKeyPressed(Input.Keys.A)) {
37-
getComponent(RectComponent.class).position.add(new Vector2(-15, 0));
38-
} else if(Gdx.input.isKeyPressed(Input.Keys.D)) {
39-
getComponent(RectComponent.class).position.add(new Vector2(15, 0));
40-
}
36+
if(Gdx.input.isKeyPressed(Input.Keys.A)) getComponent(RectComponent.class).position.add(new Vector2(-1000*Gdx.graphics.getDeltaTime(), 0));
37+
else if(Gdx.input.isKeyPressed(Input.Keys.D)) getComponent(RectComponent.class).position.add(new Vector2(1000*Gdx.graphics.getDeltaTime(), 0));
4138

4239
if(mouseMode.get()) getComponent(RectComponent.class).position.x = Gdx.input.getX()-(Gdx.graphics.getWidth()/2f-30)/4f;
4340

@@ -68,11 +65,8 @@ public void render(ImBoolean mouseMode, Ball ball) {
6865
}
6966

7067
if(main.controller != null) {
71-
if(main.controller.getButton(main.controller.getMapping().buttonDpadLeft)) {
72-
getComponent(RectComponent.class).position.add(new Vector2(-15, 0));
73-
} else if(main.controller.getButton(main.controller.getMapping().buttonDpadRight)) {
74-
getComponent(RectComponent.class).position.add(new Vector2(15, 0));
75-
}
68+
if(main.controller.getButton(main.controller.getMapping().buttonDpadLeft)) getComponent(RectComponent.class).position.add(new Vector2(-1000*Gdx.graphics.getDeltaTime(), 0));
69+
else if(main.controller.getButton(main.controller.getMapping().buttonDpadRight)) getComponent(RectComponent.class).position.add(new Vector2(1000*Gdx.graphics.getDeltaTime(), 0));
7670
}
7771
}
7872
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ashleyVersion=1.7.4
55
gdxControllersVersion=2.2.3
66
graalHelperVersion=2.0.1
77
enableGraalNative=false
8-
imguiVersion=1.87.5
8+
imguiVersion=1.88.0
99
gwtFrameworkVersion=2.11.0
1010
gwtPluginVersion=1.1.29
11-
gdxVersion=1.13.0
12-
projectVersion=1.0.2
11+
gdxVersion=1.13.1
12+
projectVersion=1.1

lwjgl3/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
3333
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
3434

35-
implementation platform("org.lwjgl:lwjgl-bom:3.3.4")
35+
implementation platform("org.lwjgl:lwjgl-bom:3.3.6")
3636

3737
implementation "org.lwjgl:lwjgl"
3838
implementation "org.lwjgl:lwjgl-glfw"

0 commit comments

Comments
 (0)