This is my first post since I can’t find what I’m looking for,
I am currently trying to create a 2D golf game for my Programming final, and would still like to continue it after its submitted. What I’m trying to accomplish is the swing/shot mechanic, I want to try and get it to function similar to how the Tiger Woods games, and a little like Wii sports works. Since those are my references. Having it in a way like real golf, by needing the correct club depending on distance, accuracy, power, having no grantee. All I have currently is a power bar and a menu that selects the clubs,yardage that have no correlation to each other at the moment. Nothing can be played so far, I’ve mostly been focused on the art, creating the tile maps for it.
If anymore explantion is needed I can provide, I may be in over my head, bit too ambitious(tend to do that alot).
I can also provide code if needed for a better look at what I have so far.
Any help/explantion is appreciated. Thank you.
2 Likes
I know nothing about golf, but how about a basic class for the club and parameters that can alter the effective range of the club?
1 Like
please search pool (billard) here in the forum
it mostly has a means of move the queue with the mouse
1 Like
I found something similar to that on the Open Processing page when I tried to look up references. I’m going about mine with a arrow that will show up on the ball, and will swing from left to right, once the button or mouse is clicked then it will start the swing meter to determine the power. Which then will all be read from for ball to move. I’m looking into the parameters, so it can help with my clubs range.
3 Likes
That power meter idea sounds good. I’m not sure if the angle idea is that great, since games like Wii golf give you more precision with the angle.
I’ve also tried making a golf game that tried to be similar to Wii golf that replaced the remote with the mouse, in that you had to move the mouse (in any direction) at a certain speed to get a good hit. If you moved the mouse too fast or too slow it would alter the hit. It also had a power bar that showed how your mouse speed corresponded to a good hit.
1 Like
That sounds amazing, since you can mess up the whole shot with the slightest mistake in golf, thats kinda what I’m looking for the games interactivity. Do you mind explaining how you did it?
I can connect it to the clubs min/max yardage, to also involve the thought process when hitting the correct club, so that it only goes up a certain power range.
1 Like
You should look into functions like mouseX and mouseY to gert current mouse position
using pmouseX and pmouseY gives previous coordinates of the mouse, so you can easily get a difference to calculate “mouse velocity”
https://processing.org/reference/pmouseX.html
however, if you just use the mouse velocity by itself to determine the force, you may have some issues. You may have to play around with it for a bit to get it right.
2 Likes
Just a sidenote: mouseX & mouseY are “system” field variables, not functions:
2 Likes