From 8c3a63c334aaf776ba9b843cb26bfe195714a0a2 Mon Sep 17 00:00:00 2001 From: Wilson Date: Tue, 21 May 2024 08:06:57 -0400 Subject: [PATCH 1/2] Improved squish physics --- src/CameluoCababas.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CameluoCababas.java b/src/CameluoCababas.java index eeca1b6..4e2ae4e 100644 --- a/src/CameluoCababas.java +++ b/src/CameluoCababas.java @@ -182,7 +182,7 @@ public void actionPerformed(ActionEvent e) { 0, JUMP_LENGTH, startingHeight, - (calculateDimension()*1.25), + (calculateDimension()*1.1), false ); From 56487d8fdaf595f952f5d45cc27708c08fd4085a Mon Sep 17 00:00:00 2001 From: Wilson Date: Tue, 21 May 2024 08:50:57 -0400 Subject: [PATCH 2/2] Priority over other windows and resize --- src/CameluoCababas.java | 6 +++--- src/Launcher.java | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CameluoCababas.java b/src/CameluoCababas.java index 4e2ae4e..7dfecce 100644 --- a/src/CameluoCababas.java +++ b/src/CameluoCababas.java @@ -86,7 +86,7 @@ public void jump() { goal = new Point( getX() + (jumpMod * JUMP_LENGTH), - (int)(frameSize.getHeight() - (frameSize.getHeight()/2)) + (int)(frameSize.getHeight() - getHeight()) ); absoluteX = getX(); @@ -151,7 +151,7 @@ private double calculateQuadraticY(double currentX, double startingX, double goa } private double calculateDimension() { - return (frameSize.getHeight()/2); + return (frameSize.getWidth() * 0.12); } @Override @@ -174,7 +174,7 @@ public void actionPerformed(ActionEvent e) { 0, JUMP_LENGTH, goal.getY(), - 0, + goal.getY() - (calculateDimension() * 0.75), false ); absoluteHeight = calculateQuadraticY( diff --git a/src/Launcher.java b/src/Launcher.java index d08519f..82ec00b 100644 --- a/src/Launcher.java +++ b/src/Launcher.java @@ -21,7 +21,9 @@ public Launcher() { setLayout(null); setBackground(new Color(0, 0, 0, 0)); getContentPane().setBackground(new Color(0, 0, 0, 0)); - setSize((int)(screenSize.getWidth()), (int)(screenSize.getHeight()*0.4)); + setSize( + screenSize + ); setLocation(0, (int)(screenSize.getHeight() - getHeight())); setAlwaysOnTop(true); setDefaultCloseOperation(EXIT_ON_CLOSE); @@ -84,7 +86,7 @@ public void run() { public void run() { while (!Thread.currentThread().isInterrupted()) { try { - Thread.sleep((long) (Math.random() * 2000) + 2000); + Thread.sleep((long) (Math.random() * 2000) + 3000); cababas.jump(); } catch (InterruptedException e) { throw new RuntimeException(e);