How do I Create Faster and Smoother Auto Platform Movement?

Get help using Construct 2

Post » Wed Jun 04, 2014 6:33 pm

@Whiteclaws After running some tests your definitely correct (though the cpu difference as you said was negligible) i ran 500 sprites moving across a blank screen which uses est 9-10% cpu using set pos and uses est 9.5-10.5% using simulate... Not sure why I though it was faster.. just seemed like my game runs smoother with simulate.. optical illusion i guess.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Thu Jun 05, 2014 4:27 pm

It's normal it runs smoother, it's not an illusion, platformer multiplies the position values by dt, so that the object will move at the same speed regardless of the fps, otherwise it would slow down if fps was under 60, you can solve that by down something like
X = x + 8 (or the increment value you want) * dt
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 05, 2014 4:36 pm

Allright, is it ok to ask another question? :D

This time, it's a flappy bird clone using Kenney arts

Image
Image

That are the screenshoots

Perform well on chrome, only using 20% of CPU usage, compiled to APK using cocoonjs and it's laggy on the start, gradually become better after 2 or 3 rock passed

Any idea to optimize it?
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Thu Jun 05, 2014 4:39 pm

As I said, try my FPS trick, it should do the job
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 05, 2014 4:43 pm

Whiteclaws wrote:As I said, try my FPS trick, it should do the job

this one?
X = x + 8 (or the increment value you want) * dt

What is dt? Deltatime?
Last edited by ijoin on Thu Jun 05, 2014 4:49 pm, edited 1 time in total.
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Thu Jun 05, 2014 4:48 pm

B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 05, 2014 4:48 pm

Repost, Ignore.
Last edited by Whiteclaws on Thu Jun 05, 2014 4:52 pm, edited 1 time in total.
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 05, 2014 4:49 pm

Repost. Ignore
Last edited by Whiteclaws on Thu Jun 05, 2014 8:55 pm, edited 1 time in total.
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 05, 2014 4:49 pm

Repost. Ignore
(God this site is buggy on tablets)

And yes ...
Last edited by Whiteclaws on Thu Jun 05, 2014 8:56 pm, edited 1 time in total.
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 05, 2014 4:54 pm

Message: ijoin can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Whiteclaws wrote:Delta-time
https://www.scirra.com/tutorials/67/del ... dependence Check this out, mate


Got it, so in order to move x-5 i need to input -300*dt
Gonna implement and test it

Thanks
B
8
S
2
Posts: 203
Reputation: 1,169

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests