Golf Ball Physics


#1

Hi! I am in the progress of making a golfing game🏌:golf:️, but have one problem... I don't know how to do physics!:scream:I need physics for the golf ball, so it moves like a real golf ball would when you hit it with the golf club. Can someone please teach me how to do physics? I would love to learn both for my golf game, and for future reference. Whoever teaches me how to do physics on Hopscotch, don't worry, I'll make sure to put you in the credits for that!:wink:


#2

This post was flagged by the community and is temporarily hidden.


#3

This post was flagged by the community and is temporarily hidden.


#4

This post was flagged by the community and is temporarily hidden.


#5

Thanks for the help, and I do want it to bounce off the edge of the screen.


#6

https://c.gethopscotch.com/p/xlulh83mb

This is a project someone made that has sort of realistic physics for a ball on a pool table. It bounces of the edges realistically. You could use the code for a miniature golf game.


#7

I'll help you tomorrow! I think I know how to.


#8

@oio is the physics master


#9

@oio, can you help me with physics? A lot of people are saying you are really good at physics and I think so too. I saw your projects, they look really cool!


#10

I'm glad I just saw this. Sure. Go ahead and tell me what you want to know. I am rebooting my computer, and will get off of this iPad and onto the computer in a couple of minutes. :slightly_smiling:


#11

I need to know how to make the golf ball bounce off of the edge of the screen and the golf club realisticlly. I don't want to only know how to do it though, I want to be able to understand it.


#12

Okay. Sorry, that took a little longer than it should have. Slow laptop. Stuff always wants to update and restart. Sick of it.

So, you want to know how to make a golf ball bounce off of the edge of the screen. Fortunately, that's generally simplest. Bouncing off of "flat" stuff is really not hard. Especially when the "flat" stuff doesn't move any.

And you want it to be "realistic". I'd like to know what you think "realistic" means.

And you want to understand it. Okay. Mind telling me what grade level you're at in school?


#13

I'm in 6th grade. What grade are you in? By realistic, I mean, I want it to look how a real golf ball would bounce off of a golf club. Start out fast, and then slow down more and more until it stops depending on how hard and quickly you hit it.


#14

This post was flagged by the community and is temporarily hidden.


#15

I'm not in school.

Hey, I like how you asked that. Or described it. You're talking about something called "drag" - the part that makes the ball slow down.

So, let me ask you something. Are we looking at this "golf" game from above? Like looking down to the ground? Or are we looking horizontally, off to the horizon? Or something else?


#16

Nope. Thank goodness. :slightly_smiling:


#17

This post was flagged by the community and is temporarily hidden.


#18

Yes, on the game i want to be looking down at the scene.


#19

Okay, let me tell you how this usually goes. I usually share one or two ideas at a time in little chunks and make sure that peeps are following, as we work our way to the final answer. It's kinda fun, but... it ends up making the thread keep popping up to the top of the list for everybody else, which is a little embarrassing to me. If that gets to be a problem for anybody, I'll ask for their patience with it. I'll try to keep it short and sweet. But the "I want to understand it" part from you (which is really important) requires us to kind of have a conversation. So, let's do that. K?


#20

Looking down is easier. That's just X and Y. Side is also X and Y. I'm using Z on a game in hopscotch. It crashes, but is doable. First real 3D game will be after that. I'm making a 2.85D. Otherwise, it just a variable on how high the ball is, then the size of the ball that depends on the variable.