Skip to content

Improve stroke line control#137

Merged
PhilippvK merged 4 commits intoPhilippvK:masterfrom
nuhakala:master
Dec 19, 2025
Merged

Improve stroke line control#137
PhilippvK merged 4 commits intoPhilippvK:masterfrom
nuhakala:master

Conversation

@nuhakala
Copy link

@nuhakala nuhakala commented Dec 7, 2025

Hello, this PR

  • Changes the alternative game mode contor (drawing dashed line) from meta key to mouse buttons to be closer to original experience. Furthermore, only clicking mouse button 1 strokes the ball, other buttons in the mouse change the gamemode.
  • Adds a custom cursor which also is closer to native experience. TBH, adding the cursor is kinda "hack" and does not improve the code. I will remove it if it is considered bad.
  • Deobfuscates few variables and one method.
  • Improves hacked shot rendering by drawing player ball instead of white rectangle at the end location.
  • Adds documentation about controls to readme

Fixes #122

@PhilippvK
Copy link
Owner

@StenAL @pehala In case you want to have a look at this, too.

Copy link
Collaborator

@pehala pehala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice and short patch.

@nuhakala
Copy link
Author

@PhilippvK Can this be merged?

@PhilippvK
Copy link
Owner

@PhilippvK Can this be merged?

While the code looks fine, I still would like to test your changes locally. I hope I will find time for this either today or tomorrow. Sorry for the delay.

@nuhakala
Copy link
Author

No problem, take your time.

I have more coming once this is merged.

@StenAL
Copy link

StenAL commented Dec 13, 2025

I think the cursor color should be changed a bit to have more contrast with background blocks.

Here I have the new cursor in the middle of the screen and it's very hard to see:
image

Comparison with the previous cursor:
image

Everything else looks good to me.

@nuhakala
Copy link
Author

Good point. I edited the cursor to have black cross inside a white cross, so now it should be visible anywhere. It does not look so original anymore, but at least is visible, since I don't know how to create dynamic contrast to it.

And my default cursor looked rather different to yours (if I had same as your I would have not created a custom one), I guess it depends on the cursors installed on the system. Using custom cursor at least makes it similar everywhere.

@PhilippvK
Copy link
Owner

I tested the patch and it seems to work (and look) fine!

@nuhakala would you mind adding a paragraph to the README which introduces the relevant keyboard/mouse controls?

Edits the logic for drawing dashed line on mouse button press instead of
keyboard button press to enable original behavior.
Adds custom cursor which is closer to original cursor. Renames method162
to setStrokeListeners.
@nuhakala
Copy link
Author

Added documentation and updated the PR description to fix the related issue.

While I checked if I had missed some controls, I noticed that I had forgot to edit the hacked shot behavior. I removed also the keyboard controls from there, so that the shooting mode is controlled only through mouse.

And when checking that, I finally figured out how to use the hacked shot and tested it myself, was kinda fun :D Anyway, it was drawing only white rectangle to the target location, so I fixed that and now it draws the player ball there.

@PhilippvK
Copy link
Owner

PhilippvK commented Dec 17, 2025

@nuhakala Thanks!

There is a small listing-related issue in the CI. Fixing it should only take a minute (or less using mvn spotless:apply). After this is done, I am happy to merge it!

https://github.com/PhilippvK/playforia-minigolf/actions/runs/20236961663/job/58326018187#step:6:1

@nuhakala
Copy link
Author

Applied now the spotless.

@PhilippvK PhilippvK merged commit 9b66eda into PhilippvK:master Dec 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation of Keyboard/Mouse controls

4 participants