Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Simplified the PhysicsBody code #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CommonSenseLies
Copy link

I'm new at both GitHub and mobile development, so bear with me.

I believe I'm sending you a "pull request", which is, to my understanding, a request for you to look at my code changes and accept or reject them. I am trying to understand the Physics World that was created in the GoneBananas game. My understanding that is that CCPhysicsSprite is created to join the Physics Box2D world with the regular CocosSharp objects that we want to see. I noticed there were some rotation calculations that were done. But, I don't think you need them. I took everything out of the game except the physics stuff. I also changed the balls to squares, so I could see the effect of what I did. And, setting the b2Body's Angle, AngularVelocity, and Angular damping and using the code I wrote seems to do the trick for accurate display. I'm pretty new at all this, so I may be missing something. (You'll need to add the constant I used somewhere as well, so the code I wrote can't just be added as is.)
public const float DEGTORAD = 0.0174532925199432957f;
public const float RADTODEG = 57.295779513082320876f;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant