0
\$\begingroup\$

In my game I have a Main class in which i am initializing starling framework by passing Game class like below

myStraling = new Starling(Game , stage);

In the game class I have Instances of Welcome class and InGame class these two classes extends starling.display.Sprite.I have a PhysicsHandling class seperately. Now i want to make instance of PhysicsHandling class in the InGame class. The physics handling class does not extend any class because it only does calculations. I have made its some variables public to position starling sprites accordingly.

My question is. Is it the right way to integrate physics in starling Performance wise .I mean is there a better way to do that

\$\endgroup\$
0
\$\begingroup\$

Should be alright if you are not using too complex shapes or too much bodies at once. If so you could reduce the Box2D frame rate ( lets say the game runs at 60 fps so you can call Box2D update on every second frame and double the ms ) or play around with velocityIterations and positionIterations to maximize performance. I actually used this trick in a game that I'm currently working on ( Starling + Box2D ) and it increased the frame rate from 30~40 fps to fluid 60 fps :)

I know that physicseditor allows you to trace polygon points from images but i personally found the result data too complex for my game.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.