motion problem

Get help using Construct 2

Post » Wed Jul 24, 2013 1:44 pm

hi friends ,

    i have a small problem, i have one car and i gave tooggle click for that car ,when clicking the angular velocity for that car is 680 and i gave 40 force at angle for that car, in destop it's working fine in mobiles it's working very slow , can any one of you please respond my question. please. 13:45:26
Posts: 19
Reputation: 238

Post » Wed Jul 24, 2013 10:51 pm

You're setting the angular velocity and applying a force every single tick - that's to say about 60 times a second.

That's both on "Is clicked" and "Else". The PC probably manages the load while i suspect a mobile phone probably can't handle it that well.

Also, are you using CocoonJS to port the game to Native first? Physics are extremely CPU consuming. CocoonJS uses an accelerated physics engine which increase FPS a lot on mobiles.

Try to rework the events - maybe make them triggered?

[code]On Left Button Clicked on Shape
->if Clicked = 0 -> Apply Force/Velocity, Set clicked to 1.
->if Clicked = 1 -> Remove Velocity, Set clicked to 0.[/code]
Another variant would be
[code]On Left Button Clicked on Shape
->if Clicked = 0 -> Set Velocity, Set clicked to 1.
->if Clicked = 1 -> Remove Velocity, Set clicked to 0.

While Clicked = 0 -> Apply Force[/code]
The first variant applies the force only once, whereas the second applies it every tick.
Try those 2 and tell us if they work better.

(BTW) Applying 0 force to an object does absolutely nothing at all, so no point in using that.Xionor2013-07-24 22:58:05
Posts: 233
Reputation: 1,537

Return to How do I....?

Who is online

Users browsing this forum: ma9ic, randomly, SnipG, totoe, Voytek and 13 guests