Skip to content

Commit

Permalink
First commit in a while
Browse files Browse the repository at this point in the history
  • Loading branch information
jthecoder12 committed Jan 18, 2025
1 parent d9e28bf commit 08c2146
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ I have uploaded native releases in the releases section.
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.

Web Version: [Click Here](https://jthecoder12.github.io/BrickBreakerNew)
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.
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.

Images:
![titlescreen](https://github.com/user-attachments/assets/1b193243-0a41-447f-9fdb-51e1d2349ca6)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/brickbreaker/main/objects/Ball.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Ball(@NotNull Engine engine, SingleplayerScene main) {

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

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

Expand Down
14 changes: 4 additions & 10 deletions core/src/main/java/brickbreaker/main/objects/Paddle.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ public void render(ImBoolean mouseMode, Ball ball) {

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

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

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

Expand Down Expand Up @@ -68,11 +65,8 @@ public void render(ImBoolean mouseMode, Ball ball) {
}

if(main.controller != null) {
if(main.controller.getButton(main.controller.getMapping().buttonDpadLeft)) {
getComponent(RectComponent.class).position.add(new Vector2(-15, 0));
} else if(main.controller.getButton(main.controller.getMapping().buttonDpadRight)) {
getComponent(RectComponent.class).position.add(new Vector2(15, 0));
}
if(main.controller.getButton(main.controller.getMapping().buttonDpadLeft)) getComponent(RectComponent.class).position.add(new Vector2(-1000*Gdx.graphics.getDeltaTime(), 0));
else if(main.controller.getButton(main.controller.getMapping().buttonDpadRight)) getComponent(RectComponent.class).position.add(new Vector2(1000*Gdx.graphics.getDeltaTime(), 0));
}
}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ashleyVersion=1.7.4
gdxControllersVersion=2.2.3
graalHelperVersion=2.0.1
enableGraalNative=false
imguiVersion=1.87.5
imguiVersion=1.88.0
gwtFrameworkVersion=2.11.0
gwtPluginVersion=1.1.29
gdxVersion=1.13.0
projectVersion=1.0.2
gdxVersion=1.13.1
projectVersion=1.1
2 changes: 1 addition & 1 deletion lwjgl3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"

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

implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-glfw"
Expand Down

0 comments on commit 08c2146

Please sign in to comment.