-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physics #18
Comments
Basic velocity class -- improve later, thanks minz |
Cool, I’ll take a look |
2nd revision: https://hastebin.com/azilisasok.java This doesn't take into account collisions, but gravity should be accounted for. |
So I'm not sure that Thoughts? |
Yeah, I've been mulling over that too. It's probably better that way, actually. |
Sounds good, i'll throw something together real quick as a proof of concept. |
I agree, btw i updated the tutorial what do you guys think. I need to include more but its the basic idea. |
Alright, pushed something to Obviously it's very simple at this point. But it's just to get the ball rolling. I was debating whether the world should handle adjusting velocity of entities based off of gravity or the entities themselves doing that. If it was done this way, then i'd propose adding a |
Very nice I like that. I think entities should handle their own velocity stuff. Could cause problems with performance if the world is handling everything maybe. |
My main concern is with how collisions would work. That's the largest problem with the physics. Any ideas? |
@Vrekt maybe entites should handle setting their own velocity and what not, but then a centralized thing handle moving them around and checking collision like @minz1 brought up. Really if we want collision i think the only way to handle it is to have one class responsible for moving entities and checking collision. Otherwise the burden would be on the implementer for handling collision. @minz1 to your question though, there's a Another thought - we need to look into adding the delta time to logic/physics calculations. From this article under point 1.2:
Having delta time and including it in physics calculations solves that |
Yeah Ill make a class soon that handles collisions where the user can call the methods within it when updateEntity is called. |
@rickbau5 That sounds like the best way to me. I'll write a quick outline of how that could work and maybe start committing something basic and working to the physics branch when I get the time. |
Oh hi I'm a bit late to the party. |
Added a basic gravity object to |
I was under the impression that Gravity and such would be done under EDIT: Also, for the way that object is written, perhaps |
I agree with @minz1 - that’s a velocity class disguised with the name gravity 😉 this class could be used as a property of entity, so this works for me. |
🤔 Fair enough. I would be inclined to name it |
Changed the Velocity class to point to a x and y instead of a |
Want to make a merge request? You can actively continue to work on the branch but it would be a better place to have these conversations |
BTW: I'm going to assign more people to this once they accept.
I'm wanting to add basic physics to the game. Something easy and simple to use. If you have an ideas please share them with me below.
Something like gravity would be simple enough. I'm thinking:
BasicPhysics.handleGravity(myEntity, direction, speed);
or something where the entity implements a physics class and it handles it automatically. I'm not sure still thinking about how to implement it.
The text was updated successfully, but these errors were encountered: