cocos-sharp-samples icon indicating copy to clipboard operation
cocos-sharp-samples copied to clipboard

Simplified the PhysicsBody code

Open CommonSenseLies opened this issue 10 years ago • 0 comments

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;

CommonSenseLies avatar Apr 25 '15 00:04 CommonSenseLies